Documentation

Linglib.Core.Semantics.Proposition

Proposition #

Theory-neutral infrastructure for modeling propositions in formal semantics. Prop' W is classical (W → Prop); BProp W is decidable (W → Bool).

@[reducible, inline]
abbrev Core.Proposition.Prop' (W : Type u_1) :
Type u_1

Classical propositions: sets of worlds (standard formal semantics).

Equations
Instances For
    @[reducible, inline]
    abbrev Core.Proposition.BProp (W : Type u_1) :
    Type u_1

    Decidable propositions: for computation.

    Equations
    Instances For
      instance Core.Proposition.bpropToProp' (W : Type u_1) :
      Coe (BProp W) (Prop' W)

      Coercion from decidable to classical propositions.

      Equations

      Propositional negation.

      Equations
      Instances For
        def Core.Proposition.Classical.pand (W : Type u_1) (p q : Prop' W) :

        Propositional conjunction.

        Equations
        Instances For
          def Core.Proposition.Classical.por (W : Type u_1) (p q : Prop' W) :

          Propositional disjunction.

          Equations
          Instances For
            def Core.Proposition.Classical.pimp (W : Type u_1) (p q : Prop' W) :

            Propositional implication.

            Equations
            Instances For

              Semantic entailment: p entails q iff q is true whenever p is true.

              Equations
              Instances For

                Grand conjunction: true at w iff all propositions in X are true at w.

                Equations
                Instances For

                  Grand disjunction: true at w iff some proposition in X is true at w.

                  Equations
                  Instances For

                    Consistency: some world satisfies all propositions in X.

                    Equations
                    Instances For

                      The always-true proposition.

                      Equations
                      Instances For

                        The always-false proposition.

                        Equations
                        Instances For
                          theorem Core.Proposition.Classical.entails_trans (W : Type u_1) (p q r : Prop' W) (hpq : entails W p q) (hqr : entails W q r) :
                          entails W p r
                          theorem Core.Proposition.Classical.equiv_symm (W : Type u_1) (p q : Prop' W) (h : equiv W p q) :
                          equiv W q p
                          theorem Core.Proposition.Classical.pnot_pnot (W : Type u_1) (p : Prop' W) :
                          entails W p (pnot W (pnot W p))
                          theorem Core.Proposition.Classical.pand_eq_inf (W : Type u_1) (p q : Prop' W) :
                          pand W p q = pq

                          Conjunction equals infimum in the lattice.

                          theorem Core.Proposition.Classical.por_eq_sup (W : Type u_1) (p q : Prop' W) :
                          por W p q = pq

                          Disjunction equals supremum in the lattice.

                          Negation equals complement in the Boolean algebra.

                          theorem Core.Proposition.Classical.entails_eq_le (W : Type u_1) (p q : Prop' W) :
                          entails W p q p q

                          Entailment equals the lattice ordering.

                          Top equals lattice top.

                          Bot equals lattice bot.

                          Propositional negation.

                          Equations
                          Instances For
                            def Core.Proposition.Decidable.pand (W : Type u_1) (p q : BProp W) :

                            Propositional conjunction.

                            Equations
                            Instances For
                              def Core.Proposition.Decidable.por (W : Type u_1) (p q : BProp W) :

                              Propositional disjunction.

                              Equations
                              Instances For

                                The always-true proposition.

                                Equations
                                Instances For

                                  The always-false proposition.

                                  Equations
                                  Instances For
                                    def Core.Proposition.Decidable.entails (W : Type u_1) (worlds : List W) (p q : BProp W) :

                                    Decidable entailment given explicit world enumeration.

                                    Equations
                                    Instances For
                                      def Core.Proposition.Decidable.equiv (W : Type u_1) (worlds : List W) (p q : BProp W) :

                                      Decidable equivalence given explicit world enumeration.

                                      Equations
                                      Instances For
                                        def Core.Proposition.Decidable.consistent (W : Type u_1) (worlds : List W) (ps : List (BProp W)) :

                                        Decidable consistency: is there a world satisfying all propositions?

                                        Equations
                                        Instances For
                                          def Core.Proposition.Decidable.count (W : Type u_1) (worlds : List W) (p : BProp W) :

                                          Count worlds satisfying a proposition.

                                          Equations
                                          Instances For
                                            def Core.Proposition.Decidable.filter (W : Type u_1) (worlds : List W) (p : BProp W) :

                                            Get all worlds satisfying a proposition.

                                            Equations
                                            Instances For
                                              theorem Core.Proposition.Decidable.pand_eq_inf (W : Type u_1) (p q : BProp W) :
                                              pand W p q = pq

                                              Conjunction equals infimum in the Bool lattice.

                                              theorem Core.Proposition.Decidable.por_eq_sup (W : Type u_1) (p q : BProp W) :
                                              por W p q = pq

                                              Disjunction equals supremum in the Bool lattice.

                                              Negation equals complement in the Bool Boolean algebra.

                                              Top equals lattice top.

                                              Bot equals lattice bot.

                                              theorem Core.Proposition.Decidable.pnot_reverses_entailment {W : Type u_1} (p q : BProp W) (h : ∀ (w : W), p w = trueq w = true) (w : W) :
                                              pnot W q w = truepnot W p w = true

                                              Negation reverses entailment (DE property).

                                              theorem Core.Proposition.Decidable.pnot_pnot {W : Type u_1} (p : BProp W) :
                                              pnot W (pnot W p) = p

                                              Double negation elimination for decidable propositions.

                                              Negation is antitone (DE): if p ≤ q pointwise, then ¬q ≤ ¬p pointwise.

                                              theorem Core.Proposition.decidable_pnot_eq_classical {W : Type u_1} (p : BProp W) :
                                              (fun (w : W) => Decidable.pnot W p w = true) = Classical.pnot W fun (w : W) => p w = true

                                              Decidable negation corresponds to Classical negation under coercion.

                                              theorem Core.Proposition.decidable_pand_eq_classical {W : Type u_1} (p q : BProp W) :
                                              (fun (w : W) => Decidable.pand W p q w = true) = Classical.pand W (fun (w : W) => p w = true) fun (w : W) => q w = true

                                              Decidable conjunction corresponds to Classical conjunction.

                                              theorem Core.Proposition.decidable_por_eq_classical {W : Type u_1} (p q : BProp W) :
                                              (fun (w : W) => Decidable.por W p q w = true) = Classical.por W (fun (w : W) => p w = true) fun (w : W) => q w = true

                                              Decidable disjunction corresponds to Classical disjunction.

                                              theorem Core.Proposition.classical_pnot_is_de {W : Type u_1} (p q : BProp W) :
                                              (∀ (w : W), (fun (w : W) => p w = true) w(fun (w : W) => q w = true) w)∀ (w : W), Classical.pnot W (fun (w : W) => q w = true) wClassical.pnot W (fun (w : W) => p w = true) w

                                              Transfer theorem: DE property of Decidable.pnot implies DE for Classical.pnot.

                                              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
                                                      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
                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For

                                                                Typeclass for types with a complete enumeration of all elements.

                                                                • worlds : List W

                                                                  List of all worlds

                                                                • complete (w : W) : w worlds

                                                                  The list is complete

                                                                Instances

                                                                  Decidable entailment using the FiniteWorlds instance.

                                                                  Equations
                                                                  Instances For

                                                                    Decidable equivalence using the FiniteWorlds instance.

                                                                    Equations
                                                                    Instances For

                                                                      Build a FiniteWorlds instance from Fintype + DecidableEq. Bridges the Mathlib Fintype convention (used by 26+ RSA files) to the linglib FiniteWorlds convention (used by 47+ files).

                                                                      Equations
                                                                      Instances For
                                                                        noncomputable def Core.Proposition.FiniteWorlds.toFintype {W : Type u_1} [fw : FiniteWorlds W] :

                                                                        Convert a FiniteWorlds instance to Fintype. Bridges in the other direction: linglib FiniteWorlds → Mathlib Fintype. Uses classical for DecidableEq needed by List.toFinset.

                                                                        Equations
                                                                        Instances For
                                                                          theorem Core.Proposition.entails_sound (W : Type u_1) [FiniteWorlds W] (p q : BProp W) :
                                                                          FiniteWorlds.entails W p q = trueClassical.entails W (fun (w : W) => p w = true) fun (w : W) => q w = true

                                                                          Decidable entailment is sound w.r.t. classical entailment.

                                                                          A simple 4-world type for basic examples.

                                                                          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.

                                                                              A simple 2-world type (true/false worlds).

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

                                                                                  Extension (Set-based): compute the worlds where all propositions hold.

                                                                                  Equations
                                                                                  Instances For

                                                                                    Intension (Set-based): compute propositions true at all given worlds.

                                                                                    Equations
                                                                                    Instances For

                                                                                      Extension is antitone: more propositions → fewer worlds.

                                                                                      Intension is antitone: fewer worlds → more propositions.

                                                                                      Galois connection: W ⊆ ext(A) ↔ A ⊆ int(W).

                                                                                      theorem Core.Proposition.GaloisConnection.galois_right {W : Type u_1} (A : Set (Prop' W)) (Ws : Set W) (h : A intension Ws) :

                                                                                      Galois connection (← direction): A ⊆ int(W) implies W ⊆ ext(A).

                                                                                      theorem Core.Proposition.GaloisConnection.galois_left {W : Type u_1} (A : Set (Prop' W)) (Ws : Set W) (h : Ws extension A) :

                                                                                      Galois connection (→ direction): W ⊆ ext(A) implies A ⊆ int(W).

                                                                                      Closure property: ext(int(W)) ⊇ W.

                                                                                      Closure property: int(ext(A)) ⊇ A.

                                                                                      Mathlib Galois connection between Set (Prop' W) and (Set W)ᵒᵈ.

                                                                                      Since extension and intension are both antitone, the adjunction lives between Set (Prop' W) and the order dual of Set W: l = toDual ∘ extension, u = intension ∘ ofDual.

                                                                                      The GC condition l A ≤ᵒᵈ b ↔ A ≤ u b unfolds to exactly the hand-proved galois_connection: Ws ⊆ ext(A) ↔ A ⊆ int(Ws).

                                                                                      Equations
                                                                                      • =
                                                                                      Instances For
                                                                                        def Core.Proposition.GaloisConnection.extensionL {W : Type u_1} (worlds : List W) (props : List (BProp W)) :

                                                                                        Extension (List-based): compute worlds where all propositions hold.

                                                                                        Equations
                                                                                        Instances For
                                                                                          def Core.Proposition.GaloisConnection.intensionL {W : Type u_1} (worlds : List W) (props : List (BProp W)) :

                                                                                          Intension (List-based): filter propositions true at all given worlds.

                                                                                          Equations
                                                                                          Instances For
                                                                                            theorem Core.Proposition.GaloisConnection.extensionL_antitone {W : Type u_1} (worlds : List W) (A B : List (BProp W)) (w : W) (hSub : pA, p B) (hw : w extensionL worlds B) :
                                                                                            w extensionL worlds A

                                                                                            Extension is antitone (List version).

                                                                                            theorem Core.Proposition.GaloisConnection.intensionL_antitone {W : Type u_1} (props : List (BProp W)) (W1 W2 : List W) (p : BProp W) (hSub : wW1, w W2) (hp : p intensionL W2 props) :
                                                                                            p intensionL W1 props

                                                                                            Intension is antitone (List version).

                                                                                            theorem Core.Proposition.GaloisConnection.closureL_expanding {W : Type u_1} (allWorlds : List W) (props : List (BProp W)) (Ws : List W) (hWs : wWs, w allWorlds) (w : W) (hw : w Ws) :
                                                                                            w extensionL allWorlds (intensionL Ws props)

                                                                                            Closure expanding (List version).

                                                                                            def Core.Proposition.GaloisConnection.intensionFW (W : Type u_1) [FiniteWorlds W] (worlds : List W) (props : List (BProp W)) :

                                                                                            FiniteWorlds version of intension.

                                                                                            Equations
                                                                                            Instances For