Type Theory Proof by reflection Marene Dimmendaal, Pleun Koldewijn - - PowerPoint PPT Presentation

type theory
SMART_READER_LITE
LIVE PREVIEW

Type Theory Proof by reflection Marene Dimmendaal, Pleun Koldewijn - - PowerPoint PPT Presentation

Type Theory Proof by reflection Marene Dimmendaal, Pleun Koldewijn Overview - What is proof by reflection? - The two main classes: - Direct computation proofs - Algebraic computation proofs - Example Direct proof - Example


slide-1
SLIDE 1

Type Theory

Marene Dimmendaal, Pleun Koldewijn

Proof by reflection

slide-2
SLIDE 2

Overview

  • What is ‘proof by reflection’?
  • The two main classes:
  • Direct computation proofs
  • Algebraic computation proofs
  • Example Direct proof
  • Example Algebraic proof
  • Summary
slide-3
SLIDE 3

What is proof by reflection?

  • Statements involving computations
  • Automated proof development system
slide-4
SLIDE 4

General presentation

  • Coq file
  • Complex combinations of reasoning steps replaced by few

computation steps

  • Two classes of problems:

Direct computation proofs Algebraic computation proofs

slide-5
SLIDE 5

Direct computation proofs

Proof of “C t”: Proof of ‘C t’:

predicate function

slide-6
SLIDE 6

Algebraic computational proofs

The reflection process relies on the following theorem:

Functions and

slide-7
SLIDE 7

Example direct computation proof

Proved by computing remainders Coq proof: A reasonably sized natural number is prime

In this case, C x is the mathematical statement for ‘x is prime’, i.e. there is no integer n (not equal to 1 or x) which divides x.

slide-8
SLIDE 8

Setting up reflection

Only smaller number need to be checked: Existence of a divisor:

slide-9
SLIDE 9

Function for division

To check presence of divisors:

slide-10
SLIDE 10

Primality

To check primality:

slide-11
SLIDE 11

Function check_range

Isn’t it simpler with two arguments?

slide-12
SLIDE 12

Duration of the functions

slide-13
SLIDE 13

Duration of the functions

slide-14
SLIDE 14

Deduced result

This is our f_correct!

slide-15
SLIDE 15

Primality proof

TTTT

This proof takes a few minutes while the naïve procedure could not cope with a number this size.

slide-16
SLIDE 16

Example Algebraic computational proofs

For set A and a binary operation *, we have that Associativity law: ( x * y ) * z = x * ( y * z ) for all x y z in A

Easily use For With

slide-17
SLIDE 17

Example Algebraic computational proofs

x y z t u x y z t u

slide-18
SLIDE 18

Example Algebraic computational proofs

x y z t u x y z t u

slide-19
SLIDE 19

Data Type and functions

Data Type A : Function f :

slide-20
SLIDE 20

Data Type and functions

Data Type A : Function i :

slide-21
SLIDE 21

The required proofs

slide-22
SLIDE 22

Example Algebraic computational proofs

x y z t u x y z t u

slide-23
SLIDE 23

Using the proof

slide-24
SLIDE 24

Ltac: transforming equation to binary tree

slide-25
SLIDE 25

Ltac: automated proof steps

slide-26
SLIDE 26

Ltac: automated proof steps

slide-27
SLIDE 27

Example Algebraic computational proofs

x y z t u x y z t u

slide-28
SLIDE 28

Generic version

For set A and a binary operation *, we have that Associativity law: ( x * y ) * z = x * ( y * z ) for all x y z in A

f x ( f ( f y z ) ( f t u ) ) represented as

slide-29
SLIDE 29

Generic version

f x ( f ( f y z ) ( f t x ) ) x y z t x x y z t x

slide-30
SLIDE 30

Generic version - theorems

Original : Generic :

slide-31
SLIDE 31

Generic version

f x ( f ( f y z ) ( f t x ) ) f x ( f ( f y z ) ( f t x ) ) cons x ( cons y ( cons z ( cons t ( cons x ) ) ) ) x y z t x x y z t x

slide-32
SLIDE 32

Generic version

f x ( f ( f y z ) ( f t x ) ) f x ( f ( f y z ) ( f t x ) ) cons x ( cons y ( cons z ( cons t ( cons x ) ) ) ) 1 2 3 1 2 3

slide-33
SLIDE 33

Generic version

f x ( f ( f y z ) ( f t x ) ) f x ( f ( f y z ) ( f t x ) ) cons x ( cons y ( cons z ( cons t ( cons x ) ) ) ) 1 2 3 1 2 3

slide-34
SLIDE 34

Generic version - theorems

slide-35
SLIDE 35

Generic version

slide-36
SLIDE 36

Generic version - with commutativity

f x ( f ( f y z ) ( f t x ) ) 1 2 3 1 2 3

slide-37
SLIDE 37

Generic version - with commutativity

f x ( f ( f y z ) ( f t x ) ) 1 2 3 1 2 3 1 2 3