Documentation

Linglib.Semantics.TypeTheoretic.Basic

Type Theory with Records — Core Foundations #

[BP83] [Coo23] [ML84] [Mon73]

Type-theoretic foundations for TTR, organized by conceptual role:

Types & Judgments: IType, PredType/Ppty, records (DepRecordType, SituationRec), IsTrue/IsFalse. Subtyping uses Lean's built-in Coe typeclass.

Type Operations: MeetType = Prod, JoinType = Sum (native Lean), Restriction = Subtype (A11.7), record merges (symmetric = Prod, asymmetric; A11.3), StringType, TypeAct.

Modal Type Systems: ModalTypeSystem (Bool-valued, Ch1 Def 54), bridge to W → Bool.

Grammar: Cat, GSign, PSRule, phrase structure rules, lexical signs.

Compositional Semantics: Ppty, Quant, semCommonNoun, semPropName, ExistWitness, semIndefArt, semBe, propExtension, existPQ.

TTR replaces possible worlds with types as the bearers of propositional content. A type is "true" when it has a witness (is inhabited) and "false" when empty. Unlike sets, types are intensional: two types can have the same witnesses yet remain distinct (groundhogwoodchuck even if co-extensional).

Native Lean type usage #

TTR ConceptLean Encoding
a : T judgmentNative typing
Predicate typesE → Type (PredType/Ppty)
Meet typesT₁ × T₂ (Prod)
Join typesSum T₁ T₂
Restriction (A11.7){ x : T // P x } (Subtype)
Symmetric merge (A11.3)T₁ × T₂ (Prod)
Dependent recordsstructure
Fixed-point types(x : E) × P x (Sigma)
IsTrue/IsFalseNonempty T/IsEmpty T

§ 1.2 Perception as type assignment #

Perceiving an object involves classifying it as being of a type. In symbols: a : T — a judgement that a is of type T. This is Lean's native typing judgement, so no new definition is needed.

The key philosophical point: you cannot perceive something without ascribing some type to it, even if very general (Thing, Entity).

§ 1.3 System of basic types (Cooper Def 1) #

A system of basic types TYPE_B = ⟨Type, A⟩ where:

In Lean, Type u already provides the universe of types, and each type T : Type u has its collection of terms. The key TTR feature that Lean does capture is intensionality at the Prop level: propext identifies logically equivalent propositions, but at Type two types can be equivalent (T ≃ S) yet not definitionally equal.

For the purposes of connecting to linguistic theory, we introduce a lightweight wrapper that makes TTR's intensional type identity explicit.

An intensional type: a named type that carries identity beyond its extension. §1.3: "there is nothing which prevents two types from being associated with exactly the same set of objects" — types are intensional.

The name field distinguishes types even when they have the same carrier. This models the groundhog/woodchuck distinction: same animals, different types.

  • carrier : Type

    The underlying Lean type (extension carrier)

  • name : String

    Intensional identity tag (e.g., a predicate name)

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Two ITypes are extensionally equivalent when their carriers are equivalent.

      Equations
      Instances For

        Two ITypes are intensionally identical when both name and carrier match.

        Equations
        • T₁.intEq T₂ = (T₁ = T₂)
        Instances For

          Meet of intensional types: compose carriers and names. Intensional identity is preserved through meet, so compositional expressions built from distinct atomic types remain distinct.

          Equations
          Instances For

            Join of intensional types: sum carriers and compose names.

            Equations
            Instances For
              theorem Semantics.TypeTheoretic.ext_equiv_not_implies_int_eq :
              ¬∀ (T₁ T₂ : IType), T₁.extEquiv T₂T₁.intEq T₂

              Core TTR thesis: extensional equivalence does not entail intensional identity. This is the formal content of Cooper's claim that types are not sets.

              § 1.4.1 Predicate types (ptypes) #

              A ptype P(a₁,...,aₙ) is a type constructed from a predicate and arguments. Witnesses are situations/events in which the predicate holds of the arguments.

              In Lean, this is naturally modeled as dependent function application: given P : α → Type (a one-place predicate-as-type-constructor), P a is the ptype whose witnesses are proofs/situations of P a.

              @[reducible, inline]

              A predicate type constructor: maps entities to types (of situations). PredType E is a one-place predicate over entities of type E. The resulting type p e is the type of situations witnessing p of e.

              Equations
              Instances For
                @[reducible, inline]

                A two-place predicate type constructor (relations).

                Equations
                Instances For
                  @[reducible, inline]
                  abbrev Semantics.TypeTheoretic.ptype {E : Type} (P : PredType E) (a : E) :

                  A ptype: the type of situations where predicate P holds of argument a. §1.4.1, Def 7: if Arity(P) = ⟨T₁,...,Tₙ⟩ and aᵢ : Tᵢ, then P(a₁,...,aₙ) ∈ PType.

                  Equations
                  Instances For
                    @[reducible, inline]
                    abbrev Semantics.TypeTheoretic.ptype2 {E : Type} (P : PredType2 E) (a b : E) :

                    A relational ptype: P(a,b) for a two-place predicate.

                    Equations
                    Instances For

                      The relationship between basic types and predicates (Cooper §1.4.1, ex 10): a : Dog iff there exists a situation e witnessing dog(a). This connects basic types (like Dog) to predicate types.

                      Equations
                      Instances For

                        § 1.4.3 Record types #

                        A record type is a collection of labelled fields where each field specifies a type. Fields may be dependent: the type of a later field can depend on the values in earlier fields.

                        Records (witnesses of record types) are labelled sets of values matching the field types.

                        In Lean, structure declarations are record types. We don't re-implement the infrastructure — we identify Lean structures with TTR records and prove the key properties Cooper establishes.

                        A simple (non-dependent) record type with two fields. Models §1.4.3, ex (18a): [ x : Ind, y : Ind, e : hug(x,y)] but without dependency (the hug field's type doesn't reference x,y).

                        • fst : T₁
                        • snd : T₂
                        Instances For
                          structure Semantics.TypeTheoretic.DepRecordType (T₁ : Type) (T₂ : T₁Type) :

                          A dependent record type: the second field's type depends on the first. This captures Cooper's dependent fields (§1.4.3.1, ex 25): [ x : Ind, c₁ : boy(x)] where the type of c₁ depends on which individual x is.

                          • fst : T₁
                          • snd : T₂ self.fst
                          Instances For
                            structure Semantics.TypeTheoretic.SituationRec (E : Type) (R : EEType) :

                            A situation record: the canonical TTR record type for event semantics. Models §1.4.3, ex (18a): [ x : Ind, y : Ind, e : hug(x,y)]

                            • x : E
                            • y : E
                            • evt : R self.x self.y
                            Instances For

                              § 1.4.3.5 Subtyping #

                              Record type T₁ is a subtype of T₂ (T₁ ⊑ T₂) iff every witness of T₁ is also a witness of T₂, regardless of what is assigned to the basic types and ptypes (Cooper Def 55 — this is a modal/universal notion).

                              For record types specifically, T₁ ⊑ T₂ when T₁ has all the fields of T₂ (plus possibly more). More fields = more specific = subtype.

                              This is the reverse of what you might expect from set inclusion: the type with MORE constraints has FEWER witnesses.

                              Subtyping via Lean's Coe #

                              Subtyping T₁ ⊑ T₂ (§1.4.3.5, Def 55) is Lean's Coe T₁ T₂ — a coercive subtyping mechanism with implicit elaboration insertion. This matches [CL20]'s preferred coercive subtyping (paper §2.4, p. 39: subsumptive subtyping "cannot be employed for an MTT"; coercive subtyping is the suitable mechanism). Composition through Coe chains via Lean's CoeHTCT; no explicit Trans registration needed.

                              structure Semantics.TypeTheoretic.BoyAndDog (E : Type) (Boy Dog : EProp) :

                              Record type with more fields is a subtype of one with fewer fields. ex (53): [x:Ind, c₁:boy(x), y:Ind, c₂:dog(y), e:hug(x,y)] is a subtype of [x:Ind, c₁:boy(x), y:Ind, c₂:dog(y)].

                              • x : E
                              • c₁ : Boy self.x
                              • y : E
                              • c₂ : Dog self.y
                              Instances For
                                structure Semantics.TypeTheoretic.BoyHugsDog (E : Type) (Boy Dog : EProp) (Hug : EEProp) extends Semantics.TypeTheoretic.BoyAndDog E Boy Dog :
                                Instances For

                                  BoyHugsDogBoyAndDog (more fields → subtype). The projection is BoyHugsDog.toBoyAndDog, automatically generated by Lean's extends. We do not register this as a Coe instance — the extra parameter Hug is in the source but not the target, so the elaborator cannot synthesize the instance from a BoyAndDog-typed context. Consumers project explicitly via .toBoyAndDog.

                                  § 1.5 Propositions as types #

                                  The central semantic thesis of TTR: types play the role of propositions.

                                  This connects to [ML84]'s propositions-as-types and to constructive mathematics' proof-by-witness.

                                  @[reducible, inline]

                                  A TTR type is "true" (inhabited). §1.5.

                                  Equations
                                  Instances For
                                    @[reducible, inline]

                                    A TTR type is "false" (empty).

                                    Equations
                                    Instances For

                                      Truth and falsity are exclusive.

                                      theorem Semantics.TypeTheoretic.IType.meet_true_iff (T₁ T₂ : IType) :
                                      IsTrue (T₁.meet T₂).carrier IsTrue T₁.carrier IsTrue T₂.carrier

                                      IType.meet truth = conjunction of component truth.

                                      theorem Semantics.TypeTheoretic.IType.join_true_iff (T₁ T₂ : IType) :
                                      IsTrue (T₁.join T₂).carrier IsTrue T₁.carrier IsTrue T₂.carrier

                                      IType.join truth = disjunction of component truth.

                                      theorem Semantics.TypeTheoretic.subtype_preserves_truth {T₁ T₂ : Type} [Coe T₁ T₂] (hT : IsTrue T₁) :
                                      IsTrue T₂

                                      Subtypes preserve truth: if T₁ ⊑ T₂ (Coe T₁ T₂) and T₁ is true, then T₂ is true.

                                      theorem Semantics.TypeTheoretic.supertype_preserves_falsity {T₁ T₂ : Type} [Coe T₁ T₂] (hF : IsFalse T₂) :
                                      IsFalse T₁

                                      Supertypes preserve falsity: if T₁ ⊑ T₂ (Coe T₁ T₂) and T₂ is false, then T₁ is false.

                                      PLift helper #

                                      propT p is a readable alias for PLift p, used throughout TTR when embedding a Prop into Type (e.g., propT (x = y) instead of PLift (x = y)).

                                      @[reducible, inline]

                                      Lift a proposition to a type. Alias for PLift.

                                      Equations
                                      Instances For

                                        Bridge to Set #

                                        Cooper's world-indexed propositions: at each world w, a proposition corresponds to a type that may or may not be inhabited. This is exactly Set W = W → Prop — at each world, we get a Prop, which in CIC is a type (in Sort 0).

                                        The bridge: Set W is a family of TTR types indexed by "possibilities" (worlds). The proposition is true at w iff the type p w is inhabited.

                                        theorem Semantics.TypeTheoretic.prop'_true_iff_inhabited {W : Type u_1} (p : Set W) (w : W) :
                                        p w Nonempty (propT (p w))

                                        A Set W proposition is TTR-true at world w iff the Prop is inhabited.

                                        Bridge to Intensional.Intension #

                                        An Intension W τ is a function from worlds to extensions. In TTR terms, this is a type family indexed by possibilities in a modal type system (Cooper Def 54). When τ = Prop, an intension is exactly a world-indexed TTR proposition.

                                        An intension of Prop is a world-indexed family of TTR propositions.

                                        A modal system of complex types TYPE_MC is a family of type systems indexed by "possibilities" M ∈ M. Basic types and predicates are shared across possibilities, but witness assignments vary.

                                        This is structurally a Kripke model: each possibility assigns extensions to predicates, just as each world assigns truth values.

                                        We formalize the connection: a modal type system over W possibilities with Bool-valued predicates is exactly a (W → Bool).

                                        @[reducible, inline]

                                        A modal type system: for each possibility and predicate, whether the predicate has witnesses. §1.4.3.5, Def 54.

                                        Equations
                                        Instances For
                                          def Semantics.TypeTheoretic.ModalTypeSystem.toBProp {W Pred : Type} (mts : ModalTypeSystem W Pred) (P : Pred) :
                                          WBool

                                          A predicate in a modal type system yields a W → Bool.

                                          Equations
                                          Instances For
                                            def Semantics.TypeTheoretic.ModalTypeSystem.subtypeBProp {W Pred : Type} (mts : ModalTypeSystem W Pred) (P₁ P₂ : Pred) :

                                            Subtyping in a modal type system: T₁ ⊑ T₂ iff at every possibility where T₁ has witnesses, T₂ also has witnesses. This is exactly propositional entailment. Def 55.

                                            Equations
                                            • mts.subtypeBProp P₁ P₂ = ∀ (w : W), mts w P₁ = truemts w P₂ = true
                                            Instances For
                                              theorem Semantics.TypeTheoretic.modal_subtype_eq_entailment {W Pred : Type} (mts : ModalTypeSystem W Pred) (P₁ P₂ : Pred) :
                                              mts.subtypeBProp P₁ P₂ {w : W | mts.toBProp P₁ w = true} {w : W | mts.toBProp P₂ w = true}

                                              Modal subtyping = propositional entailment (the bridge theorem).

                                              Bridge: IType + ModalTypeSystem → Intensional.Intension #

                                              An IType, viewed through a Bool-valued modal type system (Def 54), induces an intension (W → Bool). Whether this intension is rigid (constant across all possibilities) corresponds exactly to Intensional.Intension.IsRigid — connecting Cooper's Ch1 intensional types to the framework-agnostic intension machinery.

                                              An IType in a modal type system induces an intension. At each possibility w, the type either has witnesses (true) or not (false). Def 54: possibilities index witness assignments.

                                              Equations
                                              Instances For
                                                theorem Semantics.TypeTheoretic.IType.rigid_iff_isRigid {W : Type} (mts : ModalTypeSystem W String) (T : IType) :
                                                (toIntension mts T).IsRigid ∀ (w₁ w₂ : W), mts w₁ T.name = mts w₂ T.name

                                                An IType's intension is rigid iff it has constant witness status across all possibilities. Bridges Ch1 intensional types to IsRigid.

                                                theorem Semantics.TypeTheoretic.IType.coext_not_intEq {W : Type} (mts : ModalTypeSystem W String) (T₁ T₂ : IType) (_hCoExt : (toIntension mts T₁).CoExtensional (toIntension mts T₂)) (hNames : T₁.name T₂.name) :
                                                ¬T₁.intEq T₂

                                                Intensionally distinct ITypes can have co-extensional intensions: the groundhog/woodchuck phenomenon at the modal level.

                                                § 2.2 String theory of events #

                                                Events have temporal extent and can be decomposed into strings (sequences) of sub-events. A game of fetch decomposes into: pick_up ⌢ throw ⌢ run_after ⌢... In TTR, a string type T⁺ is the type of non-empty strings of events of type T. We model this with lists, which Lean handles natively.

                                                A string type: a non-empty sequence of typed events. §2.2: events decompose into strings of sub-events. The field ne ensures non-emptiness (TTR uses T⁺, not T*).

                                                • events : List T
                                                • ne : self.events []
                                                Instances For

                                                  String concatenation: combining two event strings. §2.2, string concatenation s₁ ⌢ s₂.

                                                  Equations
                                                  Instances For
                                                    def Semantics.TypeTheoretic.«term_⌢_» :
                                                    Lean.TrailingParserDescr
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      theorem Semantics.TypeTheoretic.StringType.concat_assoc {T : Type} (s₁ s₂ s₃ : StringType T) :
                                                      (s₁ s₂ s₃).events = (s₁ (s₂ s₃)).events

                                                      Concatenation is associative (strings form a semigroup).

                                                      A single-element string (singleton event).

                                                      Equations
                                                      Instances For

                                                        § 2.3.1 Type acts #

                                                        Agents interact with types through three fundamental acts:

                                                        These correspond to the three basic speech acts: assertion, question, command. §2.3.1, ex (30–32).

                                                        The three fundamental type acts. §2.3.1.

                                                        Instances For
                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            @[implicit_reducible]
                                                            Equations

                                                            § 2.3.3 Meet and join types (Cooper ex 42, 47) #

                                                            Meet types (T₁ ∧ T₂): a witness must be of BOTH types simultaneously. Join types (T₁ ∨ T₂): a witness is of EITHER type.

                                                            These are the type-theoretic analogues of conjunction and disjunction, and they correspond exactly to Lean's Prod and Sum.

                                                            @[reducible, inline]

                                                            Meet type: a : T₁ ∧ T₂ iff a : T₁ and a : T₂. §2.6, Def 97. In Lean, this is T₁ × T₂. We introduce an alias to make the TTR connection explicit.

                                                            Equations
                                                            Instances For
                                                              @[reducible, inline]

                                                              Join type: a : T₁ ∨ T₂ iff a : T₁ or a : T₂. §2.3.3, ex (47). In Lean, this is Sum T₁ T₂.

                                                              Equations
                                                              Instances For
                                                                theorem Semantics.TypeTheoretic.meet_true_of_both {T₁ T₂ : Type} (h₁ : IsTrue T₁) (h₂ : IsTrue T₂) :
                                                                IsTrue (MeetType T₁ T₂)

                                                                Meet of inhabited types is inhabited.

                                                                theorem Semantics.TypeTheoretic.join_true_of_left {T₁ T₂ : Type} (h : IsTrue T₁) :
                                                                IsTrue (JoinType T₁ T₂)

                                                                Join is inhabited if either component is.

                                                                theorem Semantics.TypeTheoretic.join_true_of_right {T₁ T₂ : Type} (h : IsTrue T₂) :
                                                                IsTrue (JoinType T₁ T₂)

                                                                Meet/Join subtyping (ex 98c,d and §2.3.3) is captured by Lean's native Prod.fst/Prod.snd (projection out of meet) and Sum.inl/Sum.inr (injection into join). Per mathlib idiom we do not register these as Coe instances — the (MeetType T₁ T₂) ⊑ T₁ shape leaves the other component (T₂) unrecoverable from the target type alone, so the elaborator cannot synthesize the instance. Consumers use the projections/injections explicitly.

                                                                theorem Semantics.TypeTheoretic.meet_true_iff {T₁ T₂ : Type} :
                                                                IsTrue (MeetType T₁ T₂) IsTrue T₁ IsTrue T₂

                                                                Meet preserves truth in both directions (iff). The type-theoretic analogue of conjunction introduction + elimination.

                                                                theorem Semantics.TypeTheoretic.join_true_iff {T₁ T₂ : Type} :
                                                                IsTrue (JoinType T₁ T₂) IsTrue T₁ IsTrue T₂

                                                                Join preserves truth in both directions (iff). The type-theoretic analogue of disjunction introduction + elimination.

                                                                Appendix A11.7: Restriction (T ∥ r) #

                                                                Appendix A11.7: a restriction of type T by predicate r is the type of objects of T satisfying r. This is exactly Lean's native Subtype (refinement type): { x : T // P x }.

                                                                Using Lean's Subtype directly gives us the full API for free: .val projects the underlying value, .property gives the proof.

                                                                @[reducible, inline]

                                                                Cooper's restriction T ∥ r = Lean's Subtype: the type of elements of T satisfying predicate P. Appendix A11.7.

                                                                Equations
                                                                Instances For

                                                                  Restriction (T ∥ P) ⊑ T: every restricted element projects to the base type via Subtype.val. Per mathlib idiom we do not register this as a generic Coe (Restriction T P) T instance because Lean cannot infer P from the target T alone; consumers use .val explicitly.

                                                                  theorem Semantics.TypeTheoretic.restriction_true_iff {T : Type} {P : TProp} :
                                                                  IsTrue (Restriction T P) ∃ (x : T), P x

                                                                  Truth of a restriction requires both: an element AND the predicate.

                                                                  Restriction strengthens: if T ∥ P is true, the base type T is also true (via .val projection).

                                                                  Appendix A11.3: Record merges #

                                                                  Appendix A11.3 defines two kinds of record merge:

                                                                  theorem Semantics.TypeTheoretic.symmetric_merge_is_meet (T₁ T₂ : Type) :
                                                                  MeetType T₁ T₂ = (T₁ × T₂)

                                                                  Symmetric merge is meet (product type). A11.3: μ(T₁, T₂) combines all fields of both records.

                                                                  def Semantics.TypeTheoretic.symmetric_merge_comm (T₁ T₂ : Type) :
                                                                  MeetType T₁ T₂ MeetType T₂ T₁

                                                                  Symmetric merge is commutative (up to equivalence).

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For

                                                                    Merging with Unit is identity (up to equivalence). A11.3: the empty record type acts as a merge identity.

                                                                    Equations
                                                                    Instances For

                                                                      Asymmetric merge: T₂ fields override T₁ fields. A11.3: μ_asym(T₁, T₂) takes T₁ as base and T₂ as override. Accessors prefer override fields when both provide the same label.

                                                                      • base : T₁

                                                                        The base record

                                                                      • override : T₂

                                                                        The override record (its fields take priority)

                                                                      Instances For

                                                                        Asymmetric merge with Unit override is equivalent to the base.

                                                                        Equations
                                                                        Instances For

                                                                          § 2.5 Signs (Cooper ex 70) #

                                                                          A sign pairs a speech event with its content.

                                                                          structure Semantics.TypeTheoretic.TTRSign (Phon Cont : Type) :

                                                                          A TTR sign: a pairing of speech event type and content type. §2.5, ex (70). The phonological-form field is named phon (broader linguistic terminology; Cooper writes "s-event" interchangeably).

                                                                          • phon : Phon
                                                                          • cont : Cont
                                                                          Instances For
                                                                            @[implicit_reducible]
                                                                            instance Semantics.TypeTheoretic.instReprTTRSign {Phon✝ Cont✝ : Type} [Repr Phon✝] [Repr Cont✝] :
                                                                            Repr (TTRSign Phon✝ Cont✝)
                                                                            Equations
                                                                            def Semantics.TypeTheoretic.instReprTTRSign.repr {Phon✝ Cont✝ : Type} [Repr Phon✝] [Repr Cont✝] :
                                                                            TTRSign Phon✝ Cont✝Std.Format
                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              @[implicit_reducible]
                                                                              instance Semantics.TypeTheoretic.instDecidableEqTTRSign {Phon✝ Cont✝ : Type} [DecidableEq Phon✝] [DecidableEq Cont✝] :
                                                                              DecidableEq (TTRSign Phon✝ Cont✝)
                                                                              Equations
                                                                              def Semantics.TypeTheoretic.instDecidableEqTTRSign.decEq {Phon✝ Cont✝ : Type} [DecidableEq Phon✝] [DecidableEq Cont✝] (x✝ x✝¹ : TTRSign Phon✝ Cont✝) :
                                                                              Decidable (x✝ = x✝¹)
                                                                              Equations
                                                                              Instances For
                                                                                theorem Semantics.TypeTheoretic.TTRSign.ext {Phon Cont : Type} {s t : TTRSign Phon Cont} (hphon : s.phon = t.phon) (hcont : s.cont = t.cont) :
                                                                                s = t

                                                                                Extensionality for TTR signs.

                                                                                theorem Semantics.TypeTheoretic.TTRSign.ext_iff {Phon Cont : Type} {s t : TTRSign Phon Cont} :
                                                                                s = t s.phon = t.phon s.cont = t.cont
                                                                                def Semantics.TypeTheoretic.TTRSign.map {Phon Cont Phon' Cont' : Type} (f : PhonPhon') (g : ContCont') (s : TTRSign Phon Cont) :
                                                                                TTRSign Phon' Cont'

                                                                                Map both fields of a TTR sign — the Bifunctor.bimap analogue.

                                                                                Equations
                                                                                Instances For
                                                                                  @[simp]
                                                                                  theorem Semantics.TypeTheoretic.TTRSign.map_phon {Phon Cont Phon' Cont' : Type} (f : PhonPhon') (g : ContCont') (s : TTRSign Phon Cont) :
                                                                                  (map f g s).phon = f s.phon
                                                                                  @[simp]
                                                                                  theorem Semantics.TypeTheoretic.TTRSign.map_cont {Phon Cont Phon' Cont' : Type} (f : PhonPhon') (g : ContCont') (s : TTRSign Phon Cont) :
                                                                                  (map f g s).cont = g s.cont
                                                                                  @[simp]
                                                                                  theorem Semantics.TypeTheoretic.TTRSign.map_id {Phon Cont : Type} (s : TTRSign Phon Cont) :
                                                                                  map id id s = s

                                                                                  § 3.2 Hierarchical constituent structure #

                                                                                  Events have hierarchical structure beyond flat string types.

                                                                                  Events in a bus trip. §3.2, ex (1–2).

                                                                                  Instances For
                                                                                    Equations
                                                                                    • One or more equations did not get rendered due to their size.
                                                                                    Instances For
                                                                                      @[implicit_reducible]
                                                                                      Equations

                                                                                      GetBus = WaitAtBusstop ⌢ BusArrive ⌢ GetOnBus. Cooper §3.2, ex (2).

                                                                                      Equations
                                                                                      • One or more equations did not get rendered due to their size.
                                                                                      Instances For

                                                                                        § 3.3 Syntactic categories #

                                                                                        §3.3, ex (12): Cat is a basic type with witnesses s, np, det, n, v, vp — the categories needed for the English fragment.

                                                                                        Syntactic categories for Cooper's English fragment. §3.3, ex (12).

                                                                                        Instances For
                                                                                          def Semantics.TypeTheoretic.instReprCat.repr :
                                                                                          CatStd.Format
                                                                                          Equations
                                                                                          • One or more equations did not get rendered due to their size.
                                                                                          Instances For
                                                                                            @[implicit_reducible]
                                                                                            Equations
                                                                                            theorem Semantics.TypeTheoretic.cat_lexical_has_upos (c : Cat) (h : c.isLexical = true) :
                                                                                            c.toUPOS?.isSome = true

                                                                                            Lexical categories always have a UPOS mapping.

                                                                                            inductive Semantics.TypeTheoretic.GSign (Phon Cont : Type) :

                                                                                            A grammatical sign with syntactic structure. §3.3, ex (11).

                                                                                            • mk {Phon Cont : Type} (phon : Phon) (cat : Cat) (daughters : List (GSign Phon Cont)) (cont : Cont) : GSign Phon Cont
                                                                                            Instances For
                                                                                              def Semantics.TypeTheoretic.GSign.phon {Phon Cont : Type} :
                                                                                              GSign Phon ContPhon
                                                                                              Equations
                                                                                              Instances For
                                                                                                def Semantics.TypeTheoretic.GSign.cat {Phon Cont : Type} :
                                                                                                GSign Phon ContCat
                                                                                                Equations
                                                                                                Instances For
                                                                                                  def Semantics.TypeTheoretic.GSign.daughters {Phon Cont : Type} :
                                                                                                  GSign Phon ContList (GSign Phon Cont)
                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    def Semantics.TypeTheoretic.GSign.cont {Phon Cont : Type} :
                                                                                                    GSign Phon ContCont
                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      def Semantics.TypeTheoretic.GSign.isLexical {Phon Cont : Type} (s : GSign Phon Cont) :
                                                                                                      Bool

                                                                                                      Whether a sign is lexical (NoDaughters = empty daughter string).

                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        def Semantics.TypeTheoretic.GSign.toTTRSign {Phon Cont : Type} (s : GSign Phon Cont) :
                                                                                                        TTRSign Phon Cont

                                                                                                        Project out the Ch2 sign (dropping syntactic structure).

                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          def Semantics.TypeTheoretic.lexSign {Phon Cont : Type} (phon : Phon) (c : Cat) (cont : Cont) :
                                                                                                          GSign Phon Cont

                                                                                                          Create a lexical sign (no daughters). §3.3, ex (18).

                                                                                                          Equations
                                                                                                          Instances For
                                                                                                            theorem Semantics.TypeTheoretic.lexSign_isLexical {Phon Cont : Type} (phon : Phon) (c : Cat) (cont : Cont) :
                                                                                                            (lexSign phon c cont).isLexical = true

                                                                                                            Lexical signs have no daughters by construction.

                                                                                                            § 3.3 Phrase structure rules #

                                                                                                            A phrase structure rule: mother category and ordered daughter categories. §3.3, ex (27).

                                                                                                            • mother : Cat
                                                                                                            • daughters : List Cat
                                                                                                            Instances For
                                                                                                              Equations
                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                              Instances For
                                                                                                                def Semantics.TypeTheoretic.instDecidableEqPSRule.decEq (x✝ x✝¹ : PSRule) :
                                                                                                                Decidable (x✝ = x✝¹)
                                                                                                                Equations
                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                Instances For

                                                                                                                  All fragment rules are binary (two daughters).

                                                                                                                  def Semantics.TypeTheoretic.ruleDaughters {Phon Cont : Type} (rule : PSRule) (phon : Phon) (cont : Cont) (daus : List (GSign Phon Cont)) :
                                                                                                                  GSign Phon Cont

                                                                                                                  Build a phrasal sign from a rule and daughters.

                                                                                                                  Equations
                                                                                                                  Instances For
                                                                                                                    theorem Semantics.TypeTheoretic.ruleDaughters_not_lexical {Phon Cont : Type} (rule : PSRule) (phon : Phon) (cont : Cont) (d : GSign Phon Cont) (ds : List (GSign Phon Cont)) :
                                                                                                                    (ruleDaughters rule phon cont (d :: ds)).isLexical = false

                                                                                                                    Phrasal signs (with at least one daughter) are not lexical.

                                                                                                                    § 3.4 Property and quantifier types #

                                                                                                                    §3.4 introduces the semantic type hierarchy:

                                                                                                                    These are the TTR analogues of Montague's ⟨e,t⟩ and ⟨⟨e,t⟩,t⟩.

                                                                                                                    @[reducible, inline]

                                                                                                                    A property type: maps an individual to a type of situations. §3.4, ex (30): Ppty = [x:Ind] → RecType. Alias for PredType E. Montague type: ⟨e,t⟩.

                                                                                                                    Equations
                                                                                                                    Instances For
                                                                                                                      @[reducible, inline]

                                                                                                                      A quantifier type: maps a property to a type. §3.4: Quant = Ppty → RecType. Montague type: ⟨⟨e,t⟩,t⟩ — a generalized quantifier.

                                                                                                                      Equations
                                                                                                                      Instances For

                                                                                                                        Bridge: TTR Ppty is structurally identical to PredType from §1.4.1.

                                                                                                                        § 3.4 Compositional semantics functions #

                                                                                                                        Common noun content: wrap a predicate as a property. §3.4, ex (30).

                                                                                                                        Equations
                                                                                                                        Instances For

                                                                                                                          Proper name content as a generalized quantifier. §3.4, ex (33): SemPropName(a) = λP:Ppty. P([x=a]).

                                                                                                                          Equations
                                                                                                                          Instances For
                                                                                                                            structure Semantics.TypeTheoretic.ExistWitness (E : Type) (restr scope : Ppty E) :

                                                                                                                            The existential witness record type. §3.4, ex (37).

                                                                                                                            Instances For

                                                                                                                              Indefinite article content: maps a restrictor property to a quantifier. §3.4, ex (37).

                                                                                                                              Equations
                                                                                                                              Instances For

                                                                                                                                Copula "be" for predicate nominal constructions. §3.4, ex (78).

                                                                                                                                Equations
                                                                                                                                Instances For

                                                                                                                                  § 3.4 Property extension and existential quantification #

                                                                                                                                  Property extension: whether an individual has property P. §3.4, ex (46).

                                                                                                                                  Equations
                                                                                                                                  Instances For

                                                                                                                                    Existential quantification as property-extension overlap. §3.4, ex (55).

                                                                                                                                    Equations
                                                                                                                                    Instances For
                                                                                                                                      theorem Semantics.TypeTheoretic.existPQ_iff_witness {E : Type} (P Q : Ppty E) :
                                                                                                                                      existPQ P Q Nonempty (ExistWitness E P Q)

                                                                                                                                      existPQ is equivalent to inhabitation of ExistWitness.

                                                                                                                                      theorem Semantics.TypeTheoretic.existPQ_eq_exists {E : Type} (P Q : EProp) :
                                                                                                                                      (existPQ (fun (e : E) => propT (P e)) fun (e : E) => propT (Q e)) ∃ (a : E), P a Q a

                                                                                                                                      Bridge: TTR existPQ reduces to classical ∃ when properties are Prop-valued.

                                                                                                                                      Proposition granularity: Set W vs TTR types #

                                                                                                                                      [CCGS25] §2 argue that the choice of proposition type determines what distinctions a semantic theory can make. We formalize the granularity hierarchy:

                                                                                                                                      IType (finest) > Type (medium) > Set W (coarsest)

                                                                                                                                      The key consequence: attitude verbs that need to distinguish Hesperus-beliefs from Phosphorus-beliefs cannot use Set W — they need IType.

                                                                                                                                      theorem Semantics.TypeTheoretic.prop_collapses_intensional_distinctions (W : Type u_1) :
                                                                                                                                      ∃ (T₁ : IType) (T₂ : IType), ¬T₁.intEq T₂ ∀ (embed : ITypeSet W), (∀ (T : IType) (w : W), embed T w Nonempty T.carrier)∀ (w : W), embed T₁ w embed T₂ w

                                                                                                                                      Possible-worlds propositions collapse TTR distinctions: two ITypes with different names but same carrier map to the same Prop. This is why Set W is too coarse for attitude reports.

                                                                                                                                      theorem Semantics.TypeTheoretic.ttr_strictly_finer_than_worlds :
                                                                                                                                      (∃ (T₁ : IType) (T₂ : IType), T₁.extEquiv T₂ ¬T₁.intEq T₂) ∀ (W : Type) (p q : Set W), p = q∀ (w : W), p w q w

                                                                                                                                      TTR types are strictly finer than Set W: there exist types that TTR distinguishes but Set W cannot. (This is ext_equiv_not_implies_int_eq restated in terms of the granularity hierarchy.)