Basic arithmetic implies Peano axioms

The idea behind Interface:Basic arithmetic is that it should include everything we need to conveniently do arithmetic. This module provides a minimal baseline: basic arithmetic should at least be sufficient to prove the Peano axioms. This is not trivially true because basic arithmetic lacks a successor operation and contains few of the axioms in their original form.

We import Interface:Classical propositional calculus, Interface:First-order logic with quantifiability, and Interface:Basic arithmetic and define some variables:  import (CLASSICAL Interface:Classical_propositional_calculus ) import (FIRSTORDER Interface:First-order_logic_with_quantifiability (CLASSICAL) ) import (BASIC Interface:Basic_arithmetic (CLASSICAL FIRSTORDER) )

var (formula φ) var (variable k n) var (nat a b c d a0 a1 b0 b1) 

Successor
We define the successor operation as adding one:

 def ((succ a) (a + (1))) 

Then  is a consequence of the addition builder.  thm (Successor  (((succ a) = (succ b)) ↔ (a = b)) ( a (1) b AdditionCancellationRight )) 

Addition and multiplication
The defining properties of addition and multiplication exist as theorems, or easy consequences of theorems.

 thm (AdditiveIdentity  ((a + (0)) = a) ( a AdditiveIdentityRight ))

thm (Addition  ((a + (succ b)) = (succ (a + b))) ( a b (1) AdditionAssociativity swapEquality ))

thm (MultiplicativeZero  ((a · (0)) = (0)) ( a MultiplicativeZeroRight ))

thm (Multiplication  ((a · (succ b)) = (a + (a · b))) ( b (1) AdditionCommutativity a buildMultiplicationLL

a (1) b LeftDistribution applyEqualityTransitivity

a MultiplicativeIdentityRight (a · b) buildAdditionRR applyEqualityTransitivity )) 

Induction
The only thing we need to do with induction is deal with successor versus adding one.  thm (Induction    (((subst (0) n φ) ∧     (∀ k ((subst (value k) n φ) → (subst (succ (value k)) n φ)))) → (∀ n φ)) ( n φ k InductionSubst )) 

Zero is not the successor of any number
We have saved  for last, as it is the most difficult and deepest (in terms of distinguishing natural numbers from other structures).

In particular, this proof relies both on, which rules out negative numbers, and  , which is needed to establish that more than one number exists.  thm (ZeroNotSuccessor  (¬ ((0) = (succ a))) (  We start with  and.  a ZeroSmallest

(1) ZeroSmallest ZeroOne introduceConjunction

(0) (1) LessThanLessEqual eliminateBiconditionalForward applyModusPonens  Combining these produces.  introduceConjunction (0) a (0) (1) LessEqualLessThanAddition applyModusPonens  Simplifying the left hand side gives.  (0) AdditiveIdentityLeft (a + (1)) buildLessThanRR eliminateBiconditionalReverse applyModusPonens </jh> And strict inequality and equality cannot both hold.  (0) (a + (1)) LessThanEquality applyModusPonens )) </jh>

Export
We're now ready to export Interface:Peano axioms.

 export (PEANO Interface:Peano_axioms (CLASSICAL FIRSTORDER) ) </jh>