Documentation

Linglib.Fragments.English.Toy

Toy English fragment #

The pedagogical fragment used by compositional-semantics studies, built the model-theoretic way and in mathlib's concrete-language idiom (after Mathlib/ModelTheory/Algebra/Ring/Basic.lean): arity-indexed symbol inductives (toyFunc, toyRel), the signature (toyLang), per-symbol defeq abbreviations (sleepRel, …), a structure carrying the facts (toyStructure) with one @[simp] lemma per symbol, the composition model (toyModel), and naming maps (toyNaming) from word forms into the signature. The ToyLexicon denotations are read off the model via Model.const/Model.pred₁ext/Model.pred₂ext — the connection is true by construction, with no bridge theorems.

Lives in Fragments/ so substrate files cannot import it — worked examples over this fragment belong in Studies/. The namespace remains Semantics.Montague for continuity with the engine's Lexicon.

The four entities.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      inductive Semantics.Montague.toyFunc :
      Type

      Function symbols of the toy signature: constants naming entities.

      Instances For
        inductive Semantics.Montague.toyRel :
        Type

        Relation symbols of the toy signature: content words at their arities.

        Instances For
          def Semantics.Montague.instDecidableEqToyRel.decEq {a✝ : } (x✝ x✝¹ : toyRel a✝) :
          Decidable (x✝ = x✝¹)
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Semantics.Montague.toyLang :
            FirstOrder.Language

            The toy lexical signature.

            Equations
            Instances For

              Per-symbol abbreviations with the defeq types toyLang.Constants / toyLang.Relations n (mathlib's addFunc idiom), so symbols elaborate without unfolding toyLang.

              @[reducible, inline]
              Equations
              Instances For
                @[reducible, inline]
                Equations
                Instances For
                  @[reducible, inline]
                  Equations
                  Instances For
                    @[reducible, inline]
                    Equations
                    Instances For
                      @[reducible, inline]
                      Equations
                      Instances For
                        @[reducible, inline]
                        Equations
                        Instances For
                          @[reducible, inline]
                          Equations
                          Instances For
                            @[reducible, inline]
                            Equations
                            Instances For

                              The facts #

                              The toy structure: constants denote their entities; relations carry the facts (binary relations subject-first).

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

                                One @[simp] lemma per symbol (mathlib's funMap_add discipline), so proofs reduce RelMap/funMap to the named facts without unfolding the structure.

                                @[simp]
                                theorem Semantics.Montague.funMap_john (v : Fin 0ToyEntity) :
                                FirstOrder.Language.Structure.funMap johnConst v = ToyEntity.john
                                @[simp]
                                theorem Semantics.Montague.funMap_mary (v : Fin 0ToyEntity) :
                                FirstOrder.Language.Structure.funMap maryConst v = ToyEntity.mary
                                @[simp]
                                theorem Semantics.Montague.relMap_sleep (v : Fin 1ToyEntity) :
                                FirstOrder.Language.Structure.RelMap sleepRel v = ToyFacts.sleep (v 0)
                                @[simp]
                                theorem Semantics.Montague.relMap_laugh (v : Fin 1ToyEntity) :
                                FirstOrder.Language.Structure.RelMap laughRel v = ToyFacts.laugh (v 0)
                                @[simp]
                                theorem Semantics.Montague.relMap_student (v : Fin 1ToyEntity) :
                                FirstOrder.Language.Structure.RelMap studentRel v = ToyFacts.student (v 0)
                                @[simp]
                                theorem Semantics.Montague.relMap_person (v : Fin 1ToyEntity) :
                                FirstOrder.Language.Structure.RelMap personRel v = ToyFacts.person (v 0)
                                @[simp]
                                theorem Semantics.Montague.relMap_thing (v : Fin 1ToyEntity) :
                                FirstOrder.Language.Structure.RelMap thingRel v = ToyFacts.thing (v 0)
                                @[simp]
                                theorem Semantics.Montague.relMap_pizza (v : Fin 1ToyEntity) :
                                FirstOrder.Language.Structure.RelMap pizzaRel v = ToyFacts.pizza (v 0)
                                @[simp]
                                theorem Semantics.Montague.relMap_book (v : Fin 1ToyEntity) :
                                FirstOrder.Language.Structure.RelMap bookRel v = ToyFacts.book (v 0)
                                @[simp]
                                theorem Semantics.Montague.relMap_see (v : Fin 2ToyEntity) :
                                FirstOrder.Language.Structure.RelMap seeRel v = ToyFacts.see (v 0) (v 1)
                                @[simp]
                                theorem Semantics.Montague.relMap_eat (v : Fin 2ToyEntity) :
                                FirstOrder.Language.Structure.RelMap eatRel v = ToyFacts.eat (v 0) (v 1)
                                @[simp]
                                theorem Semantics.Montague.relMap_read (v : Fin 2ToyEntity) :
                                FirstOrder.Language.Structure.RelMap readRel v = ToyFacts.read (v 0) (v 1)

                                The toy composition model: extensional (one world).

                                Equations
                                Instances For

                                  The naming maps: word forms into the toy signature.

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

                                    The toy lexicon, induced by the naming maps over the model.

                                    Equations
                                    Instances For

                                      The toy naming maps classify each word once.

                                      The default logical vocabulary is fresh for the toy naming maps.

                                      Denotations read off the model. Each is definitionally the corresponding fact predicate over ToyEntity, so rfl/trivial proofs over them reduce.