Documentation

Linglib.Theories.Semantics.Entailment.Polarity

@[reducible, inline]

IsUpwardEntailing is an abbreviation for Monotone.

A context function f : BProp World → BProp World is upward entailing if it preserves the ordering: If p ≤ q, then f(p) ≤ f(q).

Examples: "some", "or", scope of "every"

Equations
Instances For
    @[reducible, inline]

    IsDownwardEntailing is an abbreviation for Antitone.

    A context function f : BProp World → BProp World is downward entailing if it reverses the ordering: If p ≤ q, then f(q) ≤ f(p).

    Examples: "no", "not", restrictor of "every"

    Equations
    Instances For

      Identity is UE: The trivial context preserves entailment.

      Double negation is UE: negating twice preserves entailment.

      This follows from Mathlib's Antitone.comp (DE ∘ DE = UE).

      UE ∘ UE = UE (from Mathlib)

      DE ∘ DE = UE (double negation).

      Check if f is upward entailing on given test cases.

      This is a decidable approximation: it checks the property on a finite set of test cases rather than proving it universally.

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

        Check if f is downward entailing on given test cases.

        This is a decidable approximation: it checks the property on a finite set of test cases rather than proving it universally.

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

          Negation is Downward Entailing.

          If P ⊨ Q, then ¬Q ⊨ ¬P

          Test: p0 ⊨ p01, so ¬p01 ⊨ ¬p0

          Negation reverses entailment.

          p0 ⊨ p01 (true in {w0} entails true in {w0,w1}) ¬p01 ⊨ ¬p0 (false in {w0,w1} entails false in {w0})

          Conjunction (second arg) is Upward Entailing.

          If P ⊨ Q, then (R ∧ P) ⊨ (R ∧ Q)

          Disjunction (second arg) is Upward Entailing.

          If P ⊨ Q, then (R ∨ P) ⊨ (R ∨ Q)

          Material conditional with fixed consequent: "If _, then c"

          Equations
          Instances For

            Conditional antecedent is Downward Entailing.

            If P ⊨ Q, then "If Q, C" ⊨ "If P, C"

            This is the core DE property of conditional antecedents: strengthening the antecedent weakens the conditional (via contraposition).

            Example: "dogs" ⊨ "animals", so "If it's an animal, it barks" ⊨ "If it's a dog, it barks"

            Implication second argument is UE.

            If P ⊨ Q, then (A → P) ⊨ (A → Q)

            The consequent position of a conditional is upward entailing.

            Conditional positions and monotonicity.

            • Antecedent position: DE (strengthening weakens the conditional)
            • Consequent position: UE (strengthening strengthens the conditional)

            This explains scalar implicature patterns:

            • "If some passed, happy" - antecedent is DE, so SI blocked (global preferred)
            • "If passed, happy about some" - consequent is UE, so SI computed (local available)

            DE contexts reverse scalar strength.

            In UE: all ⊢ some (all is stronger, "some" implicates "not all") In DE: some ⊢ all (some is stronger, no "not all" implicature)

            A grounded UE polarity carries proof that a context function is monotone.

            Instances For

              A grounded DE polarity carries proof that a context function is antitone.

              Instances For

                A grounded polarity is either UE or DE, with proof.

                Instances For

                  Create a grounded UE polarity from a proof.

                  Equations
                  Instances For

                    Create a grounded DE polarity from a proof.

                    Equations
                    Instances For

                      Compose two grounded polarities, with proof that the composition has the right property.

                      The case analysis mirrors ContextPolarity.compose (which is derived from the EntailmentSig monoid), but additionally carries Mathlib proof witnesses:

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

                        Grounded polarity composition agrees with ContextPolarity.compose.

                        This connects the proof-carrying system to the algebraic system: the Mathlib composition lemmas produce the same polarity classification as the monoid-derived ContextPolarity.compose.

                        Double DE gives UE (grounded version).

                        "It's not the case that no one..." creates a UE context.

                        Scalar implicatures require UE context.

                        In a DE context, the alternatives reverse, so "not all" doesn't follow from "some". This function captures that constraint.

                        Equations
                        Instances For

                          Implicature is allowed under double negation.

                          "It's not the case that John didn't eat some of the cookies" → Can derive "not all" implicature because double DE = UE!