Skip to content

Instantly share code, notes, and snippets.

@jorendorff
Created May 9, 2020 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorendorff/e4ef1ef7949ddd6043f672a0a1dad6e0 to your computer and use it in GitHub Desktop.
Save jorendorff/e4ef1ef7949ddd6043f672a0a1dad6e0 to your computer and use it in GitHub Desktop.
-- Rule of Modus Ponens. The postulated inference rule of propositional
-- calculus. See e.g. Rule 1 of [Hamilton] p. 73. The rule says, "if πœ‘ is
-- true, and πœ‘ implies πœ“, then πœ“ must also be true." This rule is sometimes
-- called "detachment," since it detaches the minor premise from the major
-- premise. "Modus ponens" is short for "modus ponendo ponens," a Latin phrase
-- that means "the mode that by affirming affirms" - remark in [Sanford]
-- p. 39. This rule is similar to the rule of modus tollens mto 176.
--
-- Note: In some web page displays such as the Statement List, the symbols
-- "& " and "β‡’ " informally indicate the relationship between the hypotheses
-- and the assertion (conclusion), abbreviating the English words "and" and
-- "implies." They are not part of the formal language. (Contributed by NM,
-- 30-Sep-1992.)
--
-- ⊒ πœ‘ & ⊒ (πœ‘ β†’ πœ“) β‡’ ⊒ πœ“
def ax_mp {Ο† ψ} (a : Ο†) (ab : Ο† β†’ ψ) : ψ := ab a
-- Axiom Simp. Axiom A1 of [Margaris] p. 49. One of the 3 axioms of
-- propositional calculus. The 3 axioms are also given as Definition 2.1 of
-- [Hamilton] p. 28. This axiom is called Simp or "the principle of
-- simplification" in Principia Mathematica (Theorem *2.02 of
-- [WhiteheadRussell] p. 100) because "it enables us to pass from the joint
-- assertion of πœ‘ and πœ“ to the assertion of πœ‘ simply." It is Proposition 1 of
-- [Frege1879] p. 26, its first axiom. (Contributed by NM, 30-Sep-1992.)
-- ⊒ (πœ‘ β†’ (πœ“ β†’ πœ‘))
def ax_1 {Ο† ψ} : Ο† β†’ (ψ β†’ Ο†) :=
assume a b, a
-- Axiom Frege. Axiom A2 of [Margaris] p. 49. One of the 3 axioms of
-- propositional calculus. It "distributes" an antecedent over two
-- consequents. This axiom was part of Frege's original system and is known as
-- Frege in the literature; see Proposition 2 of [Frege1879] p. 26. It is also
-- proved as Theorem *2.77 of [WhiteheadRussell] p. 108. The other direction
-- of this axiom also turns out to be true, as demonstrated by pm5.41 364.
-- (Contributed by NM, 30-Sep-1992.)
-- ⊒ ((πœ‘ β†’ (πœ“ β†’ πœ’)) β†’ ((πœ‘ β†’ πœ“) β†’ (πœ‘ β†’ πœ’)))
def ax_2 {Ο† ψ Ο‡} : (Ο† β†’ ψ β†’ Ο‡) β†’ (Ο† β†’ ψ) β†’ Ο† β†’ Ο‡ :=
assume abc ab a, abc a (ab a)
open classical
-- Axiom Transp. Axiom A3 of [Margaris] p. 49. One of the 3 axioms of
-- propositional calculus. It swaps or "transposes" the order of the
-- consequents when negation is removed. An informal example is that the
-- statement "if there are no clouds in the sky, it is not raining" implies
-- the statement "if it is raining, there are clouds in the sky." This axiom
-- is called Transp or "the principle of transposition" in Principia
-- Mathematica (Theorem *2.17 of [WhiteheadRussell] p. 103). We will also use
-- the term "contraposition" for this principle, although the reader is
-- advised that in the field of philosophical logic, "contraposition" has a
-- different technical meaning. (Contributed by NM, 30-Sep-1992.)
-- ⊒ ((Β¬ πœ‘ β†’ Β¬ πœ“) β†’ (πœ“ β†’ πœ‘))
def ax_3 {Ο† ψ} : (¬φ β†’ ¬ψ) β†’ (ψ β†’ Ο†) := by_cases
(assume (a : Ο†) _ _, a)
(assume (na : ¬φ) (nanb : ¬φ β†’ ¬ψ) (b : ψ),
absurd b (nanb na))
-- A double modus ponens inference. (Contributed by NM, 5-Apr-1994.)
def mp2 {Ο† ψ Ο‡} (a : Ο†) (b : ψ) (f : Ο† β†’ ψ β†’ Ο‡) : Ο‡ :=
f a b
-- A double modus ponens inference. (Contributed by Mario Carneiro, 24-Jan-2013.)
-- ⊒ πœ‘ & ⊒ (πœ‘ β†’ πœ“) & ⊒ (πœ“ β†’ πœ’) β‡’ ⊒ πœ’
def mp2b {Ο† ψ Ο‡} (a : Ο†) (ab : Ο† β†’ ψ) (bc : ψ β†’ Ο‡) : Ο‡ :=
bc (ab a)
-- Description: Inference derived from axiom ax-1 6. See a1d 25 for an
-- explanation of our informal use of the terms "inference" and "deduction."
-- See also the comment in syld 44. (Contributed by NM, 29-Dec-1992.)
-- ⊒ πœ‘ β‡’ ⊒ (πœ“ β†’ πœ‘)
def a1i {Ο† ψ} (a : Ο†) : ψ β†’ Ο† :=
ax_1 a
-- Drop and replace an antecedent. (Contributed by Stefan O'Rear,
-- 29-Jan-2015.)
-- ⊒ πœ‘ & ⊒ (πœ‘ β†’ πœ“) β‡’ ⊒ (πœ’ β†’ πœ“)
def mp1i {Ο† ψ Ο‡} (a : Ο†) (ab : Ο† β†’ ψ) : Ο‡ β†’ ψ :=
a1i (ax_mp a ab)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment