Documentation

Cslib.Logics.Propositional.NaturalDeduction.Basic

Natural deduction for propositional logic #

We define, for minimal logic, deduction trees (a Type) and derivability (a Prop) relative to a Theory (set of propositions).

Main definitions #

Main results #

Notation #

The sequent ⟨Γ, A⟩ is notated Γ ⊢ A, so that a derivation using axioms from a theory T is noted T⇓(Γ ⊢ A). We define also an InferenceSystem T (Proposition Atom), so that T⇓A abbreviates a derivation of A in the empty context: T⇓(∅ ⊢ A).

Implementation notes #

We formalise here a single type of derivations, meaning there is a single collection of inference rules (those for minimal logic). The extension to intuitionistic and classical logic are modelled by adding axioms --- for instance, intuitionistic derivations are allowed to appeal to axioms of the form ⊥ → A for any proposition A. This differs from many on-paper presentations, which add that principle as a deduction rule: from Γ ⊢ ⊥ derive Γ ⊢ A. Discussion on proper way to capture such developments in cslib is ongoing, see the following zulip discussion.

References #

@[reducible, inline]
abbrev Cslib.Logic.PL.Ctx (Atom : Type u_1) :
Type u_1

Contexts are finsets of propositions.

Equations
Instances For
    def Cslib.Logic.PL.Ctx.subst {Atom Atom' : Type u} [DecidableEq Atom'] (f : AtomProposition Atom') :
    Ctx AtomCtx Atom'

    Map a context along a substitution.

    Equations
    Instances For
      @[reducible, inline]
      abbrev Cslib.Logic.PL.Sequent {Atom : Type u_1} :
      Type u_1

      Sequents {A₁, ..., Aₙ} ⊢ B.

      Equations
      Instances For

        Sequents {A₁, ..., Aₙ} ⊢ B.

        Equations
        Instances For
          inductive Cslib.Logic.PL.Theory.Derivation {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} :
          Ctx AtomProposition AtomType u

          A T-derivation of {A₁, ..., Aₙ} ⊢ B demonstrates B using (undischarged) assumptions among Aᵢ, possibly appealing to axioms from T.

          Instances For
            @[implicit_reducible]

            Inference system for derivations under the theory T.

            Equations
            @[implicit_reducible]

            Inference system for propositions (using the empty context).

            Equations
            def Cslib.Logic.PL.Theory.equiv {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} (A B : Proposition Atom) :

            An equivalence between A and B is a derivation of B from A and vice-versa.

            Equations
            Instances For
              def Cslib.Logic.PL.Theory.equiv.mp {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {A B : Proposition Atom} (e : equiv A B) :

              Forward direction of an equivalence.

              Equations
              Instances For
                def Cslib.Logic.PL.Theory.equiv.mpr {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {A B : Proposition Atom} (e : equiv A B) :

                Reverse direction of an equivalence.

                Equations
                Instances For
                  def Cslib.Logic.PL.Theory.Equiv {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} (A B : Proposition Atom) :

                  A and B are T-equivalent if T.equiv A B is nonempty.

                  Equations
                  Instances For

                    A and B are T-equivalent if T.equiv A B is nonempty.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem Cslib.Logic.PL.Theory.Equiv.mp {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {A B : Proposition Atom} (h : Equiv A B) :
                      theorem Cslib.Logic.PL.Theory.Equiv.mpr {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {A B : Proposition Atom} (h : Equiv A B) :
                      @[reducible, inline]
                      abbrev Cslib.Logic.PL.Equiv {Atom : Type u} [DecidableEq Atom] :
                      Proposition AtomProposition AtomProp

                      Minimally equivalent propositions.

                      Equations
                      Instances For

                        Minimally equivalent propositions.

                        Equations
                        Instances For

                          Operations on derivations #

                          def Cslib.Logic.PL.Theory.Derivation.weak {Atom : Type u} [DecidableEq Atom] {T T' : Theory Atom} {Γ Δ : Ctx Atom} {A : Proposition Atom} (hTheory : T T') (hCtx : Γ Δ) :
                          Derivation Γ ADerivation Δ A

                          Weakening is a derived rule.

                          Equations
                          Instances For
                            def Cslib.Logic.PL.Theory.Derivation.weak_theory {Atom : Type u} [DecidableEq Atom] {T T' : Theory Atom} {Γ : Ctx Atom} {A : Proposition Atom} (hTheory : T T') :

                            Weakening the theory only.

                            Equations
                            Instances For
                              def Cslib.Logic.PL.Theory.Derivation.weak_ctx {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {Γ Δ : Ctx Atom} {A : Proposition Atom} (hCtx : Γ Δ) :

                              Weakening the context only.

                              Equations
                              Instances For
                                theorem Cslib.Logic.PL.DerivableIn.weak {Atom : Type u} [DecidableEq Atom] {T T' : Theory Atom} {Γ Δ : Ctx Atom} {A : Proposition Atom} (hTheory : T T') (hCtx : Γ Δ) :

                                Proof irrelevant weakening.

                                theorem Cslib.Logic.PL.DerivableIn.weak_theory {Atom : Type u} [DecidableEq Atom] {T T' : Theory Atom} {Γ : Ctx Atom} {A : Proposition Atom} (hTheory : T T') :

                                Proof irrelevant weakening of the theory.

                                theorem Cslib.Logic.PL.DerivableIn.weak_ctx {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {Γ Δ : Ctx Atom} {A : Proposition Atom} (hCtx : Γ Δ) :

                                Proof irrelevant weakening of the context.

                                def Cslib.Logic.PL.Theory.Derivation.cut {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {Γ Δ : Ctx Atom} {A B : Proposition Atom} (D : InferenceSystem.derivation T (Γ, A)) (E : InferenceSystem.derivation T (insert A Δ, B)) :

                                Implement the cut rule, removing a hypothesis A from E using a derivation D. This is not substitution, which would replace appeals to A in E by the whole derivation D.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  theorem Cslib.Logic.PL.DerivableIn.cut {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {Γ Δ : Ctx Atom} {A B : Proposition Atom} :

                                  Proof irrelevant cut rule.

                                  theorem Cslib.Logic.PL.DerivableIn.cut_away {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {Γ Γ' : Ctx Atom} {B : Proposition Atom} ( : AΓ', InferenceSystem.DerivableIn T (Γ, A)) (hDer : InferenceSystem.DerivableIn T (Γ Γ', B)) :

                                  Remove unnecessary hypotheses. This can't be computable because it requires picking an order on the finset Δ.

                                  theorem Cslib.Logic.PL.DerivableIn.substAtom {Atom Atom' : Type u} [DecidableEq Atom] [DecidableEq Atom'] {T : Theory Atom} (f : AtomProposition Atom') {Γ : Ctx Atom} {B : Proposition Atom} :

                                  Properties of equivalence #

                                  def Cslib.Logic.PL.Theory.mapEquivConclusion {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} (Γ : Ctx Atom) {A B : Proposition Atom} (e : equiv A B) (D : InferenceSystem.derivation T (Γ, A)) :

                                  Change the conclusion along an equivalence.

                                  Equations
                                  Instances For
                                    def Cslib.Logic.PL.Theory.mapEquivHypothesis {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} (Γ : Ctx Atom) {A B : Proposition Atom} (e : equiv A B) (C : Proposition Atom) (D : InferenceSystem.derivation T (insert A Γ, C)) :

                                    Replace a hypothesis along an equivalence.

                                    Equations
                                    Instances For
                                      def Cslib.Logic.PL.Theory.equiv.refl {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} (A : Proposition Atom) :
                                      equiv A A

                                      An equivalence of a proposition with itself.

                                      Equations
                                      Instances For
                                        def Cslib.Logic.PL.Theory.equiv.symm {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {A B : Proposition Atom} (e : equiv A B) :
                                        equiv B A

                                        Reverse an equivalence.

                                        Equations
                                        Instances For
                                          def Cslib.Logic.PL.Theory.equiv.trans {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {A B C : Proposition Atom} (eAB : equiv A B) (eBC : equiv B C) :
                                          equiv A C

                                          Compose two equivalences.

                                          Equations
                                          Instances For

                                            A and B are equivalent (in T) iff they are provable from the same contexts.

                                            A and B are equivalent (in T) iff they have the same strength as hypotheses.

                                            theorem Cslib.Logic.PL.Theory.Equiv.refl {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} (A : Proposition Atom) :
                                            Equiv A A
                                            theorem Cslib.Logic.PL.Theory.Equiv.symm {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {A B : Proposition Atom} :
                                            Equiv A BEquiv B A
                                            theorem Cslib.Logic.PL.Theory.Equiv.trans {Atom : Type u} [DecidableEq Atom] {T : Theory Atom} {A B C : Proposition Atom} :
                                            Equiv A BEquiv B CEquiv A C

                                            Equivalence is indeed an equivalence relation.

                                            The setoid of propositions under equivalence.

                                            Equations
                                            Instances For