...
Clausal Language (ver. 5.81.21, by P.J. Voda, J. Komara, J. Kluka)
Module  Ex08b in logic: Peano arithmetic

Included module  Standard

Included module  Mtex

Included module  Mtexg

Included module  Maux

Remark 

Literature.

  • [1] Ján Komara. Specification and Verification of Programs. Online.

  • [2] Ján Kľuka. Úvod do deklaratívneho programovania. Online.

  • [3] Ján Komara. Recursive Functions. Online.


Remark 

Chapter. Numeric Programs.


Remark 

Section. Course of Values Recursion.


Remark 

Complete mathematical induction. (1 point) Show that the principle of complete mathematical induction (course of values induction) is admissible in Peano arithmetic.

Remark. Prove the claim for the special case in the following theory.

###

Theory  Complete_mathematical_induction in logic: ☆Peano arithmetic

Predicate  A displayed by Tex1_g_appl_phi_sb as  φ [ #1 ]

Axiom  Progressivity
x ( y ( y < x φ [ y ] ) φ [ x ] )
##

Lemma  Lemma
z ( z <nφ [ z ] )
##

Theorem  Conclusion
φ [x]

End of theory  Complete_mathematical_induction

Remark 

[CL] Complete mathematical induction. Syntax:

indm <variable> [; <variable(s)>]

where the induction formula is formed from the current sequent.

Example(s):

  • indmx

    φ [x] y (y<xφ [y] ) φ [x]
  • indmx;a

    φ [x] y (y<x aφ [y] ) φ [x]

Remark 

Integer division.


Function  Div  / 2 displayed by Tex_f2_n_div as  #1 ÷ #2
x ÷0=0 x ÷ y =0 y0 x<y x ÷ y = (xy) ÷y+1 y0 xy

Remark 

Exercise. Prove

y0 r (x=x÷yy+ r r <y)
##

Theorem  Spec_div
y0 r (x=x÷yy+ r r <y)

Remark 

Greatest common divisor. Euclid algorithm based on the property

x0zxzyzymodx

[CL] Remark. This property in the form of the following theorem

x0zxzymodxzy Euclid_divides_mod

is proved in the module Maux*.


Function  Gcd  / 2 displayed by Tex_f2_n_gcd as  gcd ( #1 , #2 )
gcd (0, y ) =y gcd ( x , y ) =gcd (ymodx,x) x0

Remark 

Exercise. (1 point) Prove

x0y0gcd (x,y) xgcd (x,y) y (x0y0) zxzyzgcd (x,y)

[CL] Hint. In the proof you will need the following theorem

x0ymodx<x Mod_bounded

from the module Maux*.

##

Theorem  Spec_gcd_divides
x0y0gcd (x,y) xgcd (x,y) y
##

Theorem  Spec_gcd_greatest
(x0y0) zxzyzgcd (x,y)

Query:


Results:

Heap used: 302012 free: 133913688
Time used: 0:0:0:37