K modal logic

We import Interface:Classical propositional calculus and the modal logic axioms.  import (PROPOSITIONAL Interface:Classical_propositional_calculus ) import (AXIOMS Interface:Axioms_of_K_modal_logic (PROPOSITIONAL) )

var (formula p q) 

Many of the proofs here are from Hughes and Cresswell. Their designations are often given in comments (typically one or two letters followed by digits).  thm (addNecessity ((H (p → q))) ((□ p) → (□ q)) ( #DR1 H       necessitate

p q NecessityImplication applyModusPonens ))

thm (NecessityConjunctionForward  ((□ (p ∧ q)) → ((□ p) ∧ (□ q))) ( #K1 p q ConjunctionRightElimination addNecessity

p q ConjunctionLeftElimination addNecessity

composeConjunction ))

thm (NecessityConjunctionReverse  (((□ p) ∧ (□ q)) → (□ (p ∧ q))) ( #K2 p q ConjunctionRightIntroduction addNecessity

q (p ∧ q) NecessityImplication applySyllogism

import ))

thm (NecessityConjunction  ((□ (p ∧ q)) ↔ ((□ p) ∧ (□ q))) ( #K3 p q NecessityConjunctionForward p q NecessityConjunctionReverse introduceBiconditionalFromImplications ))

thm (NecessityDisjunctionCollection  (((□ p) ∨ (□ q)) → (□ (p ∨ q))) ( #K4 p q DisjunctionRightIntroduction addNecessity

q p DisjunctionLeftIntroduction addNecessity

composeDisjunction ))

thm (buildNecessity ((H (p ↔ q))) ((□ p) ↔ (□ q)) ( #DR2 H       eliminateBiconditionalReverse addNecessity

H       eliminateBiconditionalForward addNecessity

introduceBiconditionalFromImplications ))

thm (PossibilityNecessity  ((◊ p) ↔ (¬ (□ (¬ p)))) ( (◊ p) BiconditionalReflexivity ))

thm (NecessityPossibility  ((□ p) ↔ (¬ (◊ (¬ p)))) ( #K5 (□ p) DoubleNegation

p DoubleNegation buildNecessity addNegation addNegation applyBiconditionalTransitivity ))  Hughes and Cresswell provide a general rule, called LMI, which allows one to move negation across any number of □ and ◊, provided that each □ is changed to ◊ and vice versa. JHilbert doesn't let us express it quite that way, but the next two theorems let us do that kind of rearrangement in several steps.  thm (NegationNecessity  ((¬ (□ p)) ↔ (◊ (¬ p))) ( p NecessityPossibility addNegation

(◊ (¬ p)) DoubleNegation swapBiconditional applyBiconditionalTransitivity ))

thm (NegationPossibility  ((¬ (◊ p)) ↔ (□ (¬ p))) ( p PossibilityNecessity addNegation

(□ (¬ p)) DoubleNegation swapBiconditional applyBiconditionalTransitivity ))

thm (PossibilityDisjunction  ((◊ (p ∨ q)) ↔ ((◊ p) ∨ (◊ q))) ( #K6 (p ∨ q) PossibilityNecessity

p q DeMorganPDP buildNecessity addNegation applyBiconditionalTransitivity

# Now we have ¬ □ (¬ p ∧ ¬ q)

(¬ p) (¬ q) NecessityConjunction addNegation applyBiconditionalTransitivity

# Now we have ¬ (□ ¬ p ∧ □ ¬ q)

(□ (¬ p)) (□ (¬ q)) DeMorganPCP applyBiconditionalTransitivity ))

thm (addPossibility ((H (p → q))) ((◊ p) → (◊ q)) ( #DR3 H       introduceTransposition addNecessity introduceTransposition ))

thm (buildPossibility ((H (p ↔ q))) ((◊ p) ↔ (◊ q)) ( H       addNegation buildNecessity addNegation ))

thm (PossibilityNecessityImplication  ((◊ (p → q)) ↔ ((□ p) → (◊ q))) ( #K7 p q ImplicationDisjunction buildPossibility

# we have ◊ (¬ p ∨ q)

(¬ p) q PossibilityDisjunction applyBiconditionalTransitivity

# we have ◊ ¬ p ∨ ◊ q

(◊ (¬ p)) (◊ q) DisjunctionImplication applyBiconditionalTransitivity

# we have ¬ ◊ ¬ p → ◊ q       p NecessityPossibility swapBiconditional (◊ q) buildImplicationConsequent applyBiconditionalTransitivity ))

thm (PossibilityConjunction  ((◊ (p ∧ q)) → ((◊ p) ∧ (◊ q))) ( #K8 p q ConjunctionRightElimination addPossibility

p q ConjunctionLeftElimination addPossibility

composeConjunction ))

thm (NecessityDisjunctionDistribution  ((□ (p ∨ q)) → ((□ p) ∨ (◊ q))) ( #K9 p q DisjunctionCommutativity eliminateBiconditionalReverse addNecessity

# we now have □ (q ∨ p)       q p DisjunctionImplication eliminateBiconditionalReverse addNecessity applySyllogism

# we now have □ (¬ q → p)       (¬ q) p NecessityImplication applySyllogism

# we now have □ ¬ q → □ p       q NegationPossibility (□ p) buildImplicationConsequent eliminateBiconditionalForward applySyllogism

# we now have ¬ ◊ q → □ p       (◊ q) (□ p) DisjunctionImplication eliminateBiconditionalForward applySyllogism

# we now have ◊ q ∨ □ p       (◊ q) (□ p) DisjunctionCommutativity eliminateBiconditionalReverse applySyllogism ))

export (K Interface:K_modal_logic (PROPOSITIONAL) ) 

Referenced works

 * George Edward Hughes, M. J. Cresswell (1996), A new introduction to modal logic, ISBN 978-0415126007.