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
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
Instances For
Instances For
Identity is UE: The trivial context preserves entailment.
Negation is DE: If P ⊆ Q, then ¬Q ⊆ ¬P.
Uses Core.Proposition.Decidable.pnot_antitone for the proof.
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).
UE ∘ DE = DE (from Mathlib)
DE ∘ UE = DE (from Mathlib)
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
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)
Double negation is UE (decidable verification).
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)
A grounded polarity is either UE or DE, with proof.
- ue : GroundedUE → GroundedPolarity
- de : GroundedDE → GroundedPolarity
Instances For
Extract the ContextPolarity enum from a grounded polarity.
Equations
Instances For
Create a grounded UE polarity from a proof.
Equations
- Semantics.Entailment.Polarity.mkUpward ctx h = Semantics.Entailment.Polarity.GroundedPolarity.ue { context := ctx, witness := h }
Instances For
Create a grounded DE polarity from a proof.
Equations
- Semantics.Entailment.Polarity.mkDownward ctx h = Semantics.Entailment.Polarity.GroundedPolarity.de { context := ctx, witness := h }
Instances For
The identity context is grounded UE.
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:
- UE ∘ UE = UE via
Monotone.comp - DE ∘ DE = UE via
Antitone.comp_antitone(double negation!) - UE ∘ DE = DE via
Monotone.comp_antitone - DE ∘ UE = DE via
Antitone.comp_monotone
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.
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 in identity context.
Implicature is blocked under single negation.
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!