Documentation

Linglib.Studies.Cooper2023.TTR

Cooper (2023) — the TTR apparatus #

[Coo23]

The book's type-theoretic DSL, shared by the chapter files. TTR's metatheory is the ambient type theory: the judgment a : T is Lean's native typing, record types are structures, subtyping is Coe, truth is inhabitation, meet and join are Prod and Sum. This file keeps the book's names for that identification plus the apparatus with genuinely Cooper-specific content: intensional named types (IType, §1.3), parametric — presuppositional — content (Parametric, §4.3), and the compositional entries of §3.4 and §5.6.

Truth as inhabitation (§1.5) #

@[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.

      @[reducible, inline]

      Lift a proposition to a type. Alias for PLift.

      Equations
      Instances For

        Intensional types (§1.3) #

        Types are intensional: "there is nothing which prevents two types from being associated with exactly the same set of objects". A name-tagged wrapper makes the identity-beyond-extension explicit — the groundhog ~ woodchuck distinction: same animals, different types.

        An intensional type: a named type that carries identity beyond its extension (§1.3).

        • carrier : Type

          The underlying Lean type (extension carrier)

        • name : String

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

        Instances For
          def Cooper2023.TTR.instReprIType.repr :
          ITypeStd.Format
          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.

                Equations
                Instances For

                  Join of intensional types: sum carriers and compose names.

                  Equations
                  Instances For
                    theorem Cooper2023.TTR.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 — types are not sets.

                    Meet and join types (§2.3.3, Def 97) #

                    @[reducible, inline]
                    abbrev Cooper2023.TTR.MeetType (T₁ T₂ : Type) :

                    Meet type: a : T₁ ∧ T₂ iff a : T₁ and a : T₂ — Lean's Prod.

                    Equations
                    Instances For
                      @[reducible, inline]
                      abbrev Cooper2023.TTR.JoinType (T₁ T₂ : Type) :

                      Join type: a : T₁ ∨ T₂ iff a : T₁ or a : T₂ — Lean's Sum.

                      Equations
                      Instances For
                        theorem Cooper2023.TTR.join_true_iff {T₁ T₂ : Type} :
                        IsTrue (JoinType T₁ T₂) IsTrue T₁ IsTrue T₂

                        Join preserves truth in both directions.

                        Record-type subtyping (§1.4.3.5, ex 53) #

                        A record type with more fields is a subtype of one with fewer fields (more constraints, fewer witnesses); the projection is the extends-generated forgetful map.

                        structure Cooper2023.TTR.BoyAndDog (E : Type) (Boy Dog : EProp) :

                        ex (53) target: [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 Cooper2023.TTR.BoyHugsDog (E : Type) (Boy Dog : EProp) (Hug : EEProp) extends Cooper2023.TTR.BoyAndDog E Boy Dog :

                          ex (53) source: the subtype with the additional hug field.

                          Instances For
                            @[reducible, inline]

                            A modal type system: for each possibility and predicate, whether the predicate has witnesses. Def 54; structurally a Kripke model.

                            Equations
                            Instances For

                              Compositional semantics (§3.4) #

                              The semantic type hierarchy: Ppty and Quant are the TTR analogues of Montague's ⟨e,t⟩ and ⟨⟨e,t⟩,t⟩.

                              @[reducible, inline]
                              abbrev Cooper2023.TTR.Ppty (E : Type) :

                              A property type: maps an individual to a type of situations. §3.4, ex (30).

                              Equations
                              Instances For
                                @[reducible, inline]

                                A quantifier type: maps a property to a type. §3.4.

                                Equations
                                Instances For
                                  def Cooper2023.TTR.semCommonNoun {E : Type} (p : EType) :

                                  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).

                                    Equations
                                    Instances For
                                      structure Cooper2023.TTR.ExistWitness (E : Type) (restr scope : Ppty E) :

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

                                      Instances For
                                        def Cooper2023.TTR.semIndefArt {E : Type} (restr : Ppty E) :

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

                                        Equations
                                        Instances For
                                          def Cooper2023.TTR.semBe {E : Type} (Q : Quant E) :

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

                                          Equations
                                          Instances For
                                            def Cooper2023.TTR.existPQ {E : Type} (P Q : Ppty E) :

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

                                            Equations
                                            Instances For
                                              def Cooper2023.TTR.semUniversal {E : Type} (restr scope : Ppty E) :

                                              Universal quantifier as a type. §5.6.

                                              Equations
                                              Instances For

                                                Parametric content (§4.2–4.3) #

                                                Content that depends on a context: a background type (the presupposition) paired with a foreground function from satisfying contexts to content.

                                                structure Cooper2023.TTR.Parametric (Content : Type u_1) :
                                                Type (max u_1 (u_2 + 1))

                                                Parametric content. §4.3, (14).

                                                • Bg : Type u_2

                                                  Background type — what the context must provide (presupposition)

                                                • fg : self.BgContent

                                                  Foreground — content given a context satisfying the background

                                                Instances For
                                                  @[reducible, inline]
                                                  abbrev Cooper2023.TTR.PPpty (E : Type) :
                                                  Type (u_1 + 1)

                                                  Parametric property: context-dependent property.

                                                  Equations
                                                  Instances For
                                                    def Cooper2023.TTR.Parametric.trivial {Content : Type u_1} (c : Content) :
                                                    Parametric Content

                                                    A trivial parametric content: no presupposition (bg = Unit).

                                                    Equations
                                                    Instances For
                                                      theorem Cooper2023.TTR.Parametric.trivial_fg {Content : Type u_1} (c : Content) (u : Unit) :
                                                      (trivial c).fg u = c

                                                      A trivial parametric content yields the same value for any context.

                                                      Assignments (§4.6) #

                                                      @[reducible, inline]

                                                      Variable assignment: maps natural-number indices to individuals. Equal to PartialAssign ℕ E; the alias name is retained because the book's prose uses 𝔰/𝔩/𝔯/𝔴/𝔤 as named "assignments" rather than as partial functions, and the inheritance carries the valued/valued_update_at simp set into this file's consumers.

                                                      Equations
                                                      Instances For

                                                        An assignment with at least n bindings (all indices < n defined).

                                                        Equations
                                                        • g.hasBindings n = ∀ (i : ), i < n(g i).isSome = true
                                                        Instances For

                                                          Merge two assignments (left-biased).

                                                          Equations
                                                          • g₁.merge g₂ i = (g₁ i).orElse fun (x : Unit) => g₂ i
                                                          Instances For

                                                            Merge with empty on the left returns the right assignment.

                                                            @[reducible, inline]

                                                            Propositional context.

                                                            Equations
                                                            Instances For