Documentation

Linglib.Core.Semantics.GradedProposition

Graded Propositions #

Infrastructure for graded/continuous-valued propositions (W → ℚ) used in probabilistic approaches to semantics.

@[reducible, inline]
abbrev Core.GradedProposition.GProp (W : Type u_1) :
Type u_1

A graded proposition assigns a truth degree in ℚ to each world.

Equations
Instances For
    def Core.GradedProposition.neg {W : Type u_1} (p : GProp W) :

    Graded negation: P(¬A) = 1 - P(A).

    Equations
    Instances For
      def Core.GradedProposition.conj {W : Type u_1} (p q : GProp W) :

      Graded conjunction: P(A ∧ B) = P(A) × P(B) under independence.

      Equations
      Instances For
        def Core.GradedProposition.disj {W : Type u_1} (p q : GProp W) :

        Graded disjunction: P(A ∨ B) = P(A) + P(B) - P(A)P(B) under independence.

        Equations
        Instances For
          def Core.GradedProposition.conjMin {W : Type u_1} (p q : GProp W) :

          Minimum-based conjunction (alternative to product).

          Equations
          Instances For
            def Core.GradedProposition.disjMax {W : Type u_1} (p q : GProp W) :

            Maximum-based disjunction (alternative to probabilistic or).

            Equations
            Instances For

              The always-true graded proposition (degree 1 everywhere).

              Equations
              Instances For

                The always-false graded proposition (degree 0 everywhere).

                Equations
                Instances For

                  Graded entailment: p entails q iff p(w) ≤ q(w) for all worlds.

                  Equations
                  Instances For
                    def Core.GradedProposition.equiv {W : Type u_1} (p q : GProp W) :

                    Graded equivalence: p and q have the same truth degree everywhere.

                    Equations
                    Instances For
                      Equations

                      Partial order on graded propositions.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      def Core.GradedProposition.ofBool {W : Type u_1} (p : WBool) :

                      Convert a Boolean proposition to a graded proposition.

                      Equations
                      Instances For
                        def Core.GradedProposition.boolToGProp {W : Type u_1} (p : WBool) :

                        Alias matching the existing RSA function name.

                        Equations
                        Instances For
                          theorem Core.GradedProposition.neg_involutive {W : Type u_1} (p : GProp W) :
                          neg (neg p) = p

                          Graded negation is involutive: neg (neg p) = p.

                          theorem Core.GradedProposition.neg_antitone {W : Type u_1} (p q : GProp W) (h : entails p q) :
                          entails (neg q) (neg p)

                          Graded negation is antitone: if p ≤ q then neg q ≤ neg p.

                          Negation swaps top and bot.

                          theorem Core.GradedProposition.conj_comm {W : Type u_1} (p q : GProp W) :
                          conj p q = conj q p

                          Product conjunction is commutative.

                          theorem Core.GradedProposition.conj_assoc {W : Type u_1} (p q r : GProp W) :
                          conj (conj p q) r = conj p (conj q r)

                          Product conjunction is associative.

                          theorem Core.GradedProposition.conj_top {W : Type u_1} (p : GProp W) :
                          conj p top = p

                          Top is the identity for product conjunction.

                          theorem Core.GradedProposition.top_conj {W : Type u_1} (p : GProp W) :
                          conj top p = p
                          theorem Core.GradedProposition.conj_bot {W : Type u_1} (p : GProp W) :

                          Bot is absorbing for product conjunction.

                          theorem Core.GradedProposition.disj_comm {W : Type u_1} (p q : GProp W) :
                          disj p q = disj q p

                          Probabilistic disjunction is commutative.

                          theorem Core.GradedProposition.disj_bot {W : Type u_1} (p : GProp W) :
                          disj p bot = p

                          Bot is the identity for disjunction.

                          theorem Core.GradedProposition.disj_top {W : Type u_1} (p : GProp W) :

                          Top is absorbing for disjunction.

                          theorem Core.GradedProposition.deMorgan_conj {W : Type u_1} (p q : GProp W) :
                          neg (conj p q) = disj (neg p) (neg q)

                          De Morgan's law for graded conjunction.

                          theorem Core.GradedProposition.deMorgan_disj {W : Type u_1} (p q : GProp W) :
                          neg (disj p q) = conj (neg p) (neg q)

                          De Morgan's law for graded disjunction.

                          theorem Core.GradedProposition.neg_preserves_bounds {W : Type u_1} (p : GProp W) (w : W) (h0 : 0 p w) (h1 : p w 1) :
                          0 neg p w neg p w 1

                          Negation preserves [0,1] bounds.

                          theorem Core.GradedProposition.conj_preserves_bounds {W : Type u_1} (p q : GProp W) (w : W) (hp0 : 0 p w) (hp1 : p w 1) (hq0 : 0 q w) (hq1 : q w 1) :
                          0 conj p q w conj p q w 1

                          Conjunction preserves [0,1] bounds.

                          theorem Core.GradedProposition.disj_preserves_bounds {W : Type u_1} (p q : GProp W) (w : W) (hp0 : 0 p w) (hp1 : p w 1) (hq0 : 0 q w) (hq1 : q w 1) :
                          0 disj p q w disj p q w 1

                          Disjunction preserves [0,1] bounds.

                          theorem Core.GradedProposition.conj_monotone_left {W : Type u_1} (p q r : GProp W) (hpq : entails p q) (hr : ∀ (w : W), 0 r w) :
                          entails (conj p r) (conj q r)

                          Conjunction is monotone in both arguments.

                          theorem Core.GradedProposition.disj_monotone_left {W : Type u_1} (p q r : GProp W) (hpq : entails p q) (_hr : ∀ (w : W), 0 r w) (hr1 : ∀ (w : W), r w 1) :
                          entails (disj p r) (disj q r)

                          Disjunction is monotone in both arguments.

                          theorem Core.GradedProposition.neg_ofBool {W : Type u_1} (p : WBool) :
                          neg (ofBool p) = ofBool fun (w : W) => !p w

                          When restricted to Boolean values, graded negation equals Boolean negation.

                          theorem Core.GradedProposition.conj_ofBool {W : Type u_1} (p q : WBool) :
                          conj (ofBool p) (ofBool q) = ofBool fun (w : W) => p w && q w

                          When restricted to Boolean values, graded conjunction equals Boolean conjunction.

                          theorem Core.GradedProposition.disj_ofBool {W : Type u_1} (p q : WBool) :
                          disj (ofBool p) (ofBool q) = ofBool fun (w : W) => p w || q w

                          When restricted to Boolean values, graded disjunction equals Boolean disjunction.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  @[reducible, inline]
                                  abbrev Core.GradedProposition.GPred (E : Type u_2) :
                                  Type u_2

                                  A graded predicate is a function from entities to truth degrees.

                                  Equations
                                  Instances For
                                    def Core.GradedProposition.GPred.ofBool {E : Type u_2} (p : EBool) :

                                    Lift a Boolean predicate to a graded predicate.

                                    Equations
                                    Instances For

                                      Semantic reliability parameters for a feature dimension.

                                      • onMatch :

                                        Truth degree when feature matches

                                      • onMismatch :

                                        Truth degree when feature doesn't match

                                      • match_gt_mismatch : self.onMismatch self.onMatch

                                        Match value should be higher than mismatch

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

                                          High reliability feature (like color).

                                          Equations
                                          Instances For

                                            Medium reliability feature (like size).

                                            Equations
                                            Instances For

                                              Apply a feature reliability to a Boolean match result.

                                              Equations
                                              Instances For
                                                theorem Core.GradedProposition.entails_ofBool_of_implies {W : Type u_2} (p q : WBool) (h : ∀ (w : W), p w = trueq w = true) :

                                                Entailment is preserved by ofBool.

                                                theorem Core.GradedProposition.entails_iff_bool {W : Type u_2} (p q : WBool) :
                                                entails (ofBool p) (ofBool q) ∀ (w : W), p w = trueq w = true

                                                Graded entailment reduces to Boolean entailment for {0,1} propositions.

                                                theorem Core.GradedProposition.bot_entails {W : Type u_1} (p : GProp W) (hp : ∀ (w : W), 0 p w) :

                                                Bot is the smallest graded proposition (for non-negative propositions).