Documentation

Linglib.Logic.Natural.Basic

The natural-logic relation algebra #

This file defines the seven natural-logic relations between denotations (≡, ⊑, ⊒, ^, |, ⌣, #) and the nine entailment signatures of [Ica12], with the operations of the projectivity calculus: chaining two relations, projecting a relation through a function of known signature, and composing signatures.

A relation is read non-strictly, as the conjunction of its constraint atoms: distinct relations overlap, and R ≤ R' iff R entails R', by reverse inclusion of constraint sets. The mutually exclusive seven of [MCM09] are the strict refinements. Signatures are ordered likewise by reverse inclusion of property sets; # and are the tops, and there is no bottom.

Main declarations #

Implementation notes #

compose is derived from project by probing at the relations forward and negation, so projection_composition holds by construction. Associativity of join is printed in neither source and is verified by decide. The tables are certified semantically in Logic/Natural/Soundness.lean (Relation.Holds.join, the soundFor_* rows) and shown tight in Logic/Natural/Completeness.lean, which also derives the seven relations as the nondegenerately realizable constraint conjunctions.

References #

The seven relations #

The seven natural-logic relations between denotations.

  • equiv : Relation

    Equivalence holds when the denotations coincide (couch / sofa).

  • forward : Relation

    Forward entailment holds when A ⊆ B (dog / animal).

  • reverse : Relation

    Reverse entailment holds when A ⊇ B (animal / dog).

  • negation : Relation

    Negation ^ holds when the denotations are disjoint and exhaustive (happy / unhappy).

  • alternation : Relation

    Alternation | holds when the denotations are disjoint (cat / dog).

  • cover : Relation

    Cover holds when the denotations are exhaustive (animal / nondog).

  • independent : Relation

    Independence # imposes no constraint (hungry / tall).

Instances For
    @[instance_reducible]
    Equations
    def NaturalLogic.instReprRelation.repr :
    RelationStd.Format
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The atomic lattice constraints a relation can impose ([Ica12] Definition 1.2).

      • le : Atom

        x ≤ y.

      • ge : Atom

        y ≤ x.

      • disjoint : Atom

        x ⊓ y = ⊥.

      • codisjoint : Atom

        x ⊔ y = ⊤.

      Instances For
        @[instance_reducible]
        Equations
        @[instance_reducible]
        Equations
        • One or more equations did not get rendered due to their size.
        def NaturalLogic.Relation.instReprAtom.repr :
        AtomStd.Format
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          The constraint set of a relation: each relation is the conjunction of its atoms ( = {le, ge}, ^ = {disjoint, codisjoint}, # = ), is reverse inclusion of constraint sets, and Holds is their conjunction (Relation.holds_iff in Logic/Natural/Soundness.lean). Exactly the seven images are nondegenerately realizable among the sixteen subsets (Relation.mem_range_constraints_iff in Logic/Natural/Completeness.lean).

          Equations
          Instances For
            @[instance_reducible]

            The implication order ([Ica12]'s ≪): R ≤ R' iff xRy entails xR'y — reverse inclusion of constraint sets, certified semantically by Relation.Holds.of_le. # is the top; there is no bottom: the two diamonds ( over /, ^ over |/) meet only at #, since x = y makes x,y neither disjoint nor exhaustive.

            Equations
            @[instance_reducible]
            Equations

            Join operation ⋈ ([Ica12], Lemma 1.5): given xRy and yR'z, the strongest relation guaranteed between x and z — relation-algebra join, not lattice join. The table is derived from the non-strict Holds reading, certified sound cell-by-cell by Relation.Holds.join in Logic/Natural/Soundness.lean, and tight by Relation.isLeast_join in Logic/Natural/Completeness.lean: each cell is the least relation sound for the chaining ([Ica12]'s Definition 1.4; [MCM09]'s §3 join is instead exact relation composition, valued in union relations outside the seven on 17 of the 49 cells — this table is its best single-relation weakening).

            Equations
            Instances For
              @[instance_reducible]

              The relations form a monoid under ⋈ with identity . The identity and absorption laws are printed in [Ica12] (p. 710); associativity appears in neither [Ica12] nor [MCM09] and is verified here by kernel decide. Not commutative: ^ ⋈ ⌣ = ⊑ but ⌣ ⋈ ^ = ⊒ (chaining is directional).

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

              # absorbs on the left ([Ica12] p. 710).

              @[simp]

              # absorbs on the right ([Ica12] p. 710).

              Entailment signatures #

              The function classes a relation can be projected through, from arbitrary () to anti-morphism (◇⊟).

              • all : Signature

                An arbitrary function (), projecting every relation to #.

              • mono : Signature

                A monotone function (+, upward entailing).

              • anti : Signature

                An antitone function (, downward entailing).

              • additive : Signature

                An additive function (), preserving joins.

              • antiAdd : Signature

                An anti-additive function (), turning joins into meets.

              • mult : Signature

                A multiplicative function (), preserving meets.

              • antiMult : Signature

                An anti-multiplicative function (), turning meets into joins.

              • addMult : Signature

                A morphism (⊕⊞), additive and multiplicative.

              • antiAddMult : Signature

                An anti-morphism (◇⊟), anti-additive and anti-multiplicative.

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

                  The function properties a signature can assert, closed under implication (an additive function is monotone, so 's set contains monotone).

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

                      The refinement order ([Ica12]'s ≼, §2.2): σ ≤ τ iff every σ-function is a τ-function — reverse inclusion of property sets, certified semantically by Signature.SoundFor.of_le in Logic/Natural/Soundness.lean.

                      Equations
                      @[instance_reducible]
                      Equations

                      The projection of a relation through a function of the given signature ([Ica12] Definition 2.3, computed by his Lemma 2.4): the strongest relation guaranteed between f x and f y when x R y and f has signature σ. The rows are certified sound against the function classes in Logic/Natural/Soundness.lean (soundFor_*) and tight by Signature.isLeast_project in Logic/Natural/Completeness.lean. One cell deviates from the printed table: [Ica12] prints [R]^• = # for all R (p. 715), but every function preserves equality, so his Definition 2.3 forces [≡]^• = ≡.

                      Equations
                      Instances For

                        Every signature except • preserves equiv (• is the class of arbitrary functions, which need not respect equivalence).

                        Projection preserves independent for all signatures.

                        Composition of entailment signatures ([Ica12], Lemma 2.7).

                        Derived from project: compose(ψ, φ) is the unique signature whose projection table matches projecting through φ then ψ. This makes projection_composition hold by finite verification rather than requiring two independently maintained tables to agree.

                        The signature is identified by probing with forward and negation, which suffice to distinguish all 9 signatures (• included: its probe pair is (#, #), which makes it absorbing, [Ica12] p. 716).

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

                          addMult (⊕⊞, the morphism class) is the identity for composition ([Ica12] Lemma 2.7).

                          • is absorbing: composing with the no-property class yields the no-property class ([Ica12] p. 716: φ ∘ • = • = • ∘ φ).

                          Composition is associative.

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

                          Context polarity #

                          Whether a context preserves or reverses entailment — the coarse UE/DE quotient of Signature (toContextPolarity).

                          • upward : ContextPolarity

                            The context preserves entailment (upward entailing).

                          • downward : ContextPolarity

                            The context reverses entailment (downward entailing).

                          • nonMonotonic : ContextPolarity

                            The context is neither monotone nor antitone (exactly n).

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

                              Map an entailment signature to the coarser ContextPolarity type, derived from project.

                              A signature is UE iff it preserves forward entailment ([⊑]^φ = ⊑), DE iff it reverses it ([⊑]^φ = ⊒).

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

                                toContextPolarity is a monoid homomorphism: composing signatures then coarsening gives the same result as coarsening then composing polarities.

                                This theorem connects the fine-grained Signature monoid to the coarse ContextPolarity composition, ensuring the two systems can never disagree.

                                The projectivity signature of a position, as the monoid product of the signatures along its path, listed root-first (outermost context first): [Ica12]'s marking recursion pro(s(u)) = top(s) ∘ pro(u) (Definition 2.9). Under the projection action, mul_smul applies the innermost — last — signature to the relation first. For example, contextProjectivity [.antiAdd, .addMult] = .antiAdd: an intersective modifier inside a no-restrictor leaves the position anti-additive.

                                Equations
                                Instances For

                                  Projection composition #

                                  Projecting through φ and then ψ projects through the composite signature ([Ica12] Definition 2.6 and Lemma 2.7) — the mul_smul law of MulAction Signature Relation. Since compose is derived from project by probing at forward and negation, the content is that the two probes determine the whole table.

                                  @[simp]
                                  theorem NaturalLogic.Signature.smul_def (σ : Signature) (R : Relation) :
                                  σ R = project R σ
                                  @[instance_reducible]

                                  Projection is an action of the signature monoid on the relations: projection_composition is the mul_smul law.

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

                                  The negation signature #

                                  Negation has the anti-morphism signature ◇⊟ (strongest DE signature).

                                  Equations
                                  Instances For