feat (Logics/Propositional/NaturalDeduction): Natural deduction for propositional logic #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NJ
This pull request formalises (a version of) Gentzen's system NJ for propositional logic.
Files
Propositional.Defs
: defines the type of propositions.Propositional.NaturalDeduction.Basic
: defines the type of derivations and their basic properties, including weakening and substitution. Also develops equivalence of propositions.Propositional.NaturalDeduction.Theorems
: derives some elementary equivalences and implications, such as De Morgan's laws, multiple negations, and so forth.Notes
We develop natural deduction for minimal logic, and define derivability relative to a theory (set of propositions). Then intuitionistic (resp. classical) derivability is obtained by adding the principle of explosion (resp. double-negation elimination).
There are some non-obvious design choices to be made here, specifically in the definition of
Derivation
. On the grounds of simplicity, I believe these are relatively optimal.Atom
apart from decidable equality, in particular it need not be inhabited. It then has a bottom element wheneverAtom
does, and a top element wheneverAtom
is inhabited. This will make the definitions of algebraic semantics more natural: for minimal logic the semantics are naturally defined for generalised Heyting algebras, which have a top but no bottom.Finset
's of propositions as contexts — this avoids explicit contraction and exchange, and is very easy to work with usinggrind
.implI {A B : Proposition Atom} (Γ : Ctx Atom) : Derivation ⟨insert A Γ, B⟩ → Derivation ⟨Γ, impl A B⟩
, and our convention manifests as not forbiddingA ∈ Γ
(or, equivalently, a rule with typeDerivation ⟨Γ, B⟩ → Derivation ⟨Γ \ {A}, impl A B⟩
).Less obvious, & something I am looking for feedback on is the way I have treated theories. An alternative, which might be cleaner once sufficient API is developed, would be to have two kinds of axiom rules, one for propositions
A ∈ Γ
(context) and a separate one forA ∈ T
(theory). This would restore the simplicity of the definition ofDerivable
, to something like