The Next Generation of Proof Assistants

234
the next generation of proof assistants Freek Wiedijk Radboud University Nijmegen The Netherlands 2010 08 31 , 16 : 30 LSFA 2010 Natal, Brazil

Transcript of The Next Generation of Proof Assistants

Page 1: The Next Generation of Proof Assistants

the next generation of proof assistants

Freek Wiedijk

Radboud University NijmegenThe Netherlands

2010 08 31 , 16 : 30

LSFA 2010Natal, Brazil

Page 2: The Next Generation of Proof Assistants

the next generation of proof assistants:

ten questions

Freek Wiedijk

Radboud University NijmegenThe Netherlands

2010 08 31 , 16 : 30

LSFA 2010Natal, Brazil

Page 3: The Next Generation of Proof Assistants

the state of the art

Page 4: The Next Generation of Proof Assistants

1some of the best current proof assistants

ACL2

B method

PVS

HOL

Isabelle

Coq

Mizar

Twelf

Metamath

Page 5: The Next Generation of Proof Assistants

1some of the best current proof assistants

ACL2

B method

PVS

HOL����:

-XXXXXzHOL4

HOL Light

ProofPowerIsabelle

Coq

Mizar

Twelf

Metamath

Page 6: The Next Generation of Proof Assistants

1some of the best current proof assistants

ACL2

B method

PVS

HOL����:

-XXXXXz?HOL4

HOL Light

ProofPowerIsabelle

Coq

Mizar

Twelf

Metamath

Page 7: The Next Generation of Proof Assistants

1some of the best current proof assistants

ACL2

B method

PVS

HOL����:

-XXXXXz?HOL4

HOL Light

ProofPowerIsabelle

Coq -XXXXXzssreflect

MatitaMizar

Twelf

Metamath

Page 8: The Next Generation of Proof Assistants

1some of the best current proof assistants

ACL2

B method

PVS

HOL����:

-XXXXXz?HOL4

HOL Light

ProofPowerIsabelle

Coq -XXXXXzssreflect

MatitaMizar

Twelf

Metamath

+

+

+

+

ITP

2010

Page 9: The Next Generation of Proof Assistants

1some of the best current proof assistants

ACL2

B method

PVS

HOL����:

-XXXXXz?HOL4

HOL Light

ProofPowerIsabelle

Coq -XXXXXzssreflect

MatitaMizar

Twelf

Metamath

+

+

+

+

ITP

2010

+

+

+

PO

PLm

ark

Page 10: The Next Generation of Proof Assistants

1some of the best current proof assistants

ACL2

B method

PVS

HOL����:

-XXXXXz?HOL4

HOL Light

ProofPowerIsabelle

Coq -XXXXXzssreflect

MatitaMizar

Twelf

Metamath

+

+

+

+

ITP

2010

+

+

+

PO

PLm

ark

+

+

+

+

100

theo

rems

Page 11: The Next Generation of Proof Assistants

1some of the best current proof assistants

ACL2

B method

PVS

HOL����:

-XXXXXz?HOL4

HOL Light

ProofPowerIsabelle

Coq -XXXXXzssreflect

MatitaMizar

Twelf

Metamath

+

+

+

+

com

puters

+

+

+

logic

+

+

+

+

math

ematics

Page 12: The Next Generation of Proof Assistants

1some of the best current proof assistants

ACL2

B method

PVS

HOL����:

-XXXXXz?HOL4

HOL Light

ProofPowerIsabelle

Coq -XXXXXzssreflect

MatitaMizar

Twelf

Metamath

+

+

+

+

+

+

com

puters

+

+

+

logic

+

+

+

+

math

ematics

Page 13: The Next Generation of Proof Assistants

1some of the best current proof assistants

ACL2

B method

PVS

HOL����:

-XXXXXz?HOL4

HOL Light

ProofPowerIsabelle

Coq -XXXXXzssreflect

MatitaMizar

Twelf

Metamath

+

+

+

+

+

+

com

puters

+

+

+

logic

+

+

+

+

+

math

ematics

Page 14: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

Page 15: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

circuits made of electronic components like transistors

Page 16: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 17: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 18: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 19: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 20: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

low level programming languages like C

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 21: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

high level programming languages like Haskell

low level programming languages like C

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 22: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

system level programs like operating systems and device drivers

high level programming languages like Haskell

low level programming languages like C

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 23: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

programmer level programs like compilers and databases engines

system level programs like operating systems and device drivers

high level programming languages like Haskell

low level programming languages like C

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 24: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

user level programs like word processors and web browsers

programmer level programs like compilers and databases engines

system level programs like operating systems and device drivers

high level programming languages like Haskell

low level programming languages like C

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 25: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

non-user level programs like computer games

user level programs like word processors and web browsers

programmer level programs like compilers and databases engines

system level programs like operating systems and device drivers

high level programming languages like Haskell

low level programming languages like C

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 26: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

non-user level programs like computer games

user level programs like word processors and web browsers

programmer level programs like compilers and databases engines

system level programs like operating systems and device drivers

high level programming languages like Haskell

low level programming languages like C

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 27: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

non-user level programs like computer games

user level programs like word processors and web browsers

programmer level programs like compilers and databases engines

system level programs like operating systems and device drivers

high level programming languages like Haskell

low level programming languages like C

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 28: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

non-user level programs like computer games

user level programs like word processors and web browsers

programmer level programs like compilers and databases engines

system level programs like operating systems and device drivers

high level programming languages like Haskell

low level programming languages like C

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 29: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

non-user level programs like computer games

user level programs like word processors and web browsers

programmer level programs like compilers and databases engines

system level programs like operating systems and device drivers

high level programming languages like Haskell

low level programming languages like C

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 30: The Next Generation of Proof Assistants

2the computer science spectrum of formal proof

non-user level programs like computer games

user level programs like word processors and web browsers

programmer level programs like compilers and databases engines

system level programs like operating systems and device drivers

high level programming languages like Haskell

low level programming languages like C

assembly programming languages

machine code

circuits specified on the register transfer level like in Verilog

circuits made of logical gates as described in a netlist

circuits made of electronic components like transistors

Page 31: The Next Generation of Proof Assistants

3formally proving a processor correct

ARM6 architecture ARMv3 instruction set

Anthony Fox, HOL4, University of Cambridge, 2002

Page 32: The Next Generation of Proof Assistants

4formally proving a compiler correct

Xavier Leroy, Coq, INRIA, 2006

Page 33: The Next Generation of Proof Assistants

5formally proving an operating system correct

Gerwin Klein, Isabelle, NICTA, 2009

L4.verified project = verification of seL4 microkernel

1 microkernel8,700 lines of C

0 bugs∗

qed

∗conditions apply

Page 34: The Next Generation of Proof Assistants

5formally proving an operating system correct

Gerwin Klein, Isabelle, NICTA, 2009

L4.verified project = verification of seL4 microkernel

1 microkernel8,700 lines of C

0 bugs∗

qed

5,700 lines of Haskell

∗conditions apply

Page 35: The Next Generation of Proof Assistants

5formally proving an operating system correct

Gerwin Klein, Isabelle, NICTA, 2009

L4.verified project = verification of seL4 microkernel

1 microkernel8,700 lines of C

0 bugs∗

qed

5,700 lines of Haskell

117,000 lines of Isabelle20 person-years

∗conditions apply

Page 36: The Next Generation of Proof Assistants

5formally proving an operating system correct

Gerwin Klein, Isabelle, NICTA, 2009

L4.verified project = verification of seL4 microkernel

1 microkernel8,700 lines of C

0 bugs∗

qed

5,700 lines of Haskell

117,000 lines of Isabelle20 person-years

∗conditions apply

Page 37: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

Page 38: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

elementary school mathematics = arithmetic

Page 39: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 40: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

undergraduate mathematics

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 41: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

graduate mathematics

undergraduate mathematics

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 42: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

research mathematics

graduate mathematics

undergraduate mathematics

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 43: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

research mathematics

graduate mathematics

undergraduate mathematics

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 44: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 45: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

proofs with large computer calculations four color theorem

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 46: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

recent solutions to famous open problems

proofs with large computer calculations four color theorem

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 47: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

recent solutions to famous open problems P 6= NP?

proofs with large computer calculations four color theorem

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 48: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

proofs that are a large team effort classification of finite simple groups

recent solutions to famous open problems P 6= NP?

proofs with large computer calculations four color theorem

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 49: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

proofs that are a large team effort classification of finite simple groups

recent solutions to famous open problems P 6= NP?

↑ Kepler conjecture

proofs with large computer calculations four color theorem

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 50: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

proofs that are a large team effort classification of finite simple groups

↑ Fermat’s last theorem

recent solutions to famous open problems P 6= NP?

↑ Kepler conjecture

proofs with large computer calculations four color theorem

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 51: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

proofs that are a large team effort classification of finite simple groups

↑ Fermat’s last theorem

recent solutions to famous open problems P 6= NP?

↑ Kepler conjecture

proofs with large computer calculations four color theorem

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 52: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

proofs that are a large team effort classification of finite simple groups

↑ Fermat’s last theorem

recent solutions to famous open problems P 6= NP?

↑ Kepler conjecture

proofs with large computer calculations four color theorem

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 53: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

proofs that are a large team effort classification of finite simple groups

↑ Fermat’s last theorem

recent solutions to famous open problems P 6= NP?

↑ Kepler conjecture

proofs with large computer calculations four color theorem

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 54: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

proofs that are a large team effort classification of finite simple groups

↑ Fermat’s last theorem

recent solutions to famous open problems P 6= NP?

↑ Kepler conjecture

proofs with large computer calculations four color theorem

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 55: The Next Generation of Proof Assistants

6the mathematics spectrum of formal proof

proofs that are a large team effort classification of finite simple groups

↑ Fermat’s last theorem

recent solutions to famous open problems P 6= NP?

↑ Kepler conjecture

proofs with large computer calculations four color theorem

research mathematics

graduate mathematics prime number theorem

↑ Jordan curve theorem

undergraduate mathematics fundamental theorem of algebra

high school mathematics = basic algebra and calculus

elementary school mathematics = arithmetic

Page 56: The Next Generation of Proof Assistants

7formally proving the prime number theorem

John Harrison, HOL Light, Intel, 2008

2πiF (w) =

ΓF (z + w)N z

(

1

z+

z

R2

)

dz

&%'$qq

qetcetera

ALL_TAC] THEN

SUBGOAL_THEN

‘((\z. f(w + z) * Cx(&N) cpow z * (Cx(&1) / z + z / Cx(R) pow 2))

has_path_integral (Cx(&2) * Cx pi * ii * f(w))) (A ++ B)‘

ASSUME_TAC THENL

[MP_TAC(ISPECL

etcetera

Page 57: The Next Generation of Proof Assistants

8formally proving the four color theorem

Georges Gonthier, Coq/ssreflect, Microsoft + INRIA, 2006

◮ Appel & Haken, 1976assembly program

◮ Robertson, Sanders, Seymour & Thomas, 1997C program

◮ Gonthierpurely functional (= no state) OCaml program

Page 58: The Next Generation of Proof Assistants

8formally proving the four color theorem

Georges Gonthier, Coq/ssreflect, Microsoft + INRIA, 2006

◮ Appel & Haken, 1976assembly program

◮ Robertson, Sanders, Seymour & Thomas, 1997C program

◮ Gonthierpurely functional (= no state) OCaml→Coq program

Page 59: The Next Generation of Proof Assistants

proof assistants: the next generation

Page 60: The Next Generation of Proof Assistants

9an email from Tobias Nipkow

Message-ID: <[email protected]>

Date: Thu, 10 Jan 2008 08:24:13 +0100

From: Tobias Nipkow <[email protected]>

To: Freek Wiedijk <[email protected]>

Subject: Re: [Fwd: free ultrafilters]

[ . . . ]

> I personally _hate_ the totality of the HOL logic. Don’t

> you?

Occasionally I do. But mostly not.

The next generation of proof assistants will take it into account.

[ . . . ]

Page 61: The Next Generation of Proof Assistants

9an email from Tobias Nipkow

��+

me

Message-ID: <[email protected]>

Date: Thu, 10 Jan 2008 08:24:13 +0100

From: Tobias Nipkow <[email protected]>

To: Freek Wiedijk <[email protected]>

Subject: Re: [Fwd: free ultrafilters]

[ . . . ]

> I personally _hate_ the totality of the HOL logic. Don’t

> you?

Occasionally I do. But mostly not.

The next generation of proof assistants will take it into account.

[ . . . ]

Page 62: The Next Generation of Proof Assistants

9an email from Tobias Nipkow

��+

me

QQk

Tobias

Message-ID: <[email protected]>

Date: Thu, 10 Jan 2008 08:24:13 +0100

From: Tobias Nipkow <[email protected]>

To: Freek Wiedijk <[email protected]>

Subject: Re: [Fwd: free ultrafilters]

[ . . . ]

> I personally _hate_ the totality of the HOL logic. Don’t

> you?

Occasionally I do. But mostly not.

The next generation of proof assistants will take it into account.

[ . . . ]

Page 63: The Next Generation of Proof Assistants

9an email from Tobias Nipkow

��+

me

QQk

Tobias

Message-ID: <[email protected]>

Date: Thu, 10 Jan 2008 08:24:13 +0100

From: Tobias Nipkow <[email protected]>

To: Freek Wiedijk <[email protected]>

Subject: Re: [Fwd: free ultrafilters]

[ . . . ]

> I personally _hate_ the totality of the HOL logic. Don’t

> you?

Occasionally I do. But mostly not.

The next generation of proof assistants will take it into account.

[ . . . ]

Page 64: The Next Generation of Proof Assistants

I

should the next generation of proof assistantsbe based on ZFC set theory?

Page 65: The Next Generation of Proof Assistants

I

should the next generation of proof assistantsbe based on ZFC set theory?

ACL2B method

PVSHOL

IsabelleCoqMizarTwelf

Metamath

Page 66: The Next Generation of Proof Assistants

I

should the next generation of proof assistantsbe based on ZFC set theory?

ACL2B method

PVSHOL

IsabelleCoqMizarTwelf

Metamath

Page 67: The Next Generation of Proof Assistants

I

should the next generation of proof assistantsbe based on ZFC set theory?

ACL2B method

PVSHOL

IsabelleCoqMizarTwelf

Metamath

Page 68: The Next Generation of Proof Assistants

I

should the next generation of proof assistantsbe based on ZFC set theory?

ACL2B method

PVSHOL

Isabelle/ZFCoqMizarTwelf

Metamath

Page 69: The Next Generation of Proof Assistants

10foundations for proof assistants

◮ set theory (Mizar, Isabelle/ZF, Metamath, B method)

Zermelo-Fraenkel axioms + axiom of Choice

◮ type theory (Coq, Twelf)

Curry-Howard isomorphism

◮ higher order logic (HOL, Isabelle/HOL, PVS)

◮ primitive recursive arithmetic (ACL2)

Page 70: The Next Generation of Proof Assistants

10foundations for proof assistants

◮ set theory (Mizar, Isabelle/ZF, Metamath, B method)

Zermelo-Fraenkel axioms + axiom of Choiceuntyped, not computational, classical, canonical

◮ type theory (Coq, Twelf)

Curry-Howard isomorphism

◮ higher order logic (HOL, Isabelle/HOL, PVS)

◮ primitive recursive arithmetic (ACL2)

Page 71: The Next Generation of Proof Assistants

10foundations for proof assistants

◮ set theory (Mizar, Isabelle/ZF, Metamath, B method)

Zermelo-Fraenkel axioms + axiom of Choiceuntyped, not computational, classical, canonical

◮ type theory (Coq, Twelf)

Curry-Howard isomorphismtyped, computational, intuitionistic, many variations

◮ higher order logic (HOL, Isabelle/HOL, PVS)

◮ primitive recursive arithmetic (ACL2)

Page 72: The Next Generation of Proof Assistants

10foundations for proof assistants

◮ set theory (Mizar, Isabelle/ZF, Metamath, B method)

Zermelo-Fraenkel axioms + axiom of Choiceuntyped, not computational, classical, canonical

◮ type theory (Coq, Twelf)

Curry-Howard isomorphism, predicative? intensional?

typed, computational, intuitionistic, many variations

◮ higher order logic (HOL, Isabelle/HOL, PVS)

◮ primitive recursive arithmetic (ACL2)

Page 73: The Next Generation of Proof Assistants

10foundations for proof assistants

◮ set theory (Mizar, Isabelle/ZF, Metamath, B method)

Zermelo-Fraenkel axioms + axiom of Choiceuntyped, not computational, classical, canonical

◮ type theory (Coq, Twelf)

Curry-Howard isomorphism, predicative? intensional?

typed, computational, intuitionistic, many variations

◮ higher order logic (HOL, Isabelle/HOL, PVS)

typed, not computational, classical, canonical

◮ primitive recursive arithmetic (ACL2)

Page 74: The Next Generation of Proof Assistants

10foundations for proof assistants

◮ set theory (Mizar, Isabelle/ZF, Metamath, B method)

Zermelo-Fraenkel axioms + axiom of Choiceuntyped, not computational, classical, canonical

◮ type theory (Coq, Twelf)

Curry-Howard isomorphism, predicative? intensional?

typed, computational, intuitionistic, many variations

◮ higher order logic (HOL, Isabelle/HOL, PVS)

typed, not computational, classical, canonical

◮ primitive recursive arithmetic (ACL2)

untyped, computational, classical, canonical

Page 75: The Next Generation of Proof Assistants

10foundations for proof assistants

◮ set theory (Mizar, Isabelle/ZF, Metamath, B method)

Zermelo-Fraenkel axioms + axiom of Choiceuntyped, not computational, classical, canonical

◮ type theory (Coq, Twelf)

Curry-Howard isomorphism, predicative? intensional?

typed, computational, intuitionistic, many variationsas expressive as set theory

◮ higher order logic (HOL, Isabelle/HOL, PVS)

typed, not computational, classical, canonical

◮ primitive recursive arithmetic (ACL2)

untyped, computational, classical, canonical

Page 76: The Next Generation of Proof Assistants

10foundations for proof assistants

◮ set theory (Mizar, Isabelle/ZF, Metamath, B method)

Zermelo-Fraenkel axioms + axiom of Choiceuntyped, not computational, classical, canonical

◮ type theory (Coq, Twelf)

Curry-Howard isomorphism, predicative? intensional?

typed, computational, intuitionistic, many variationsas expressive as set theory

◮ higher order logic (HOL, Isabelle/HOL, PVS)

typed, not computational, classical, canonicalless expressive

◮ primitive recursive arithmetic (ACL2)

untyped, computational, classical, canonical

Page 77: The Next Generation of Proof Assistants

10foundations for proof assistants

◮ set theory (Mizar, Isabelle/ZF, Metamath, B method)

Zermelo-Fraenkel axioms + axiom of Choiceuntyped, not computational, classical, canonical

◮ type theory (Coq, Twelf)

Curry-Howard isomorphism, predicative? intensional?

typed, computational, intuitionistic, many variationsas expressive as set theory

◮ higher order logic (HOL, Isabelle/HOL, PVS)

typed, not computational, classical, canonicalless expressive

◮ primitive recursive arithmetic (ACL2)

untyped, computational, classical, canonicaleven less expressive

Page 78: The Next Generation of Proof Assistants

11first order logic versus higher order logic

‘canonical logic’ = classical first order predicate logic with equality

Page 79: The Next Generation of Proof Assistants

11first order logic versus higher order logic

‘canonical logic’ = classical first order predicate logic with equality

first order logic∩

higher order logic∩

first order logic + set theory

Page 80: The Next Generation of Proof Assistants

11first order logic versus higher order logic

‘canonical logic’ = classical first order predicate logic with equality

first order logic∩

higher order logic∩

first order logic + schemes + set theory

Page 81: The Next Generation of Proof Assistants

11first order logic versus higher order logic

‘canonical logic’ = classical first order predicate logic with equality

first order logic∩

higher order logic∩

first order logic + schemes + set theory

binders{x ∈ A | P (x)}

∑ni=1 ai

limx→a f(x)∫

f(x)dx

Page 82: The Next Generation of Proof Assistants

II

should the next generation of proof assistantshave an advanced type system?

Page 83: The Next Generation of Proof Assistants

II

should the next generation of proof assistantshave an advanced type system?

ACL2B method

PVSHOL

IsabelleCoqMizarTwelf

Metamath

Page 84: The Next Generation of Proof Assistants

12soft types

◮ no types (Metamath)

◮ hard types (PVS, HOL, Isabelle, Coq, Twelf)

types are part of the foundation

◮ soft types (ACL2, B method, Mizar)

types are a layer on top of an untyped foundation

Page 85: The Next Generation of Proof Assistants

12soft types

◮ no types (Metamath)

◮ hard types (PVS, HOL, Isabelle, Coq, Twelf)

types are part of the foundation

◮ soft types (ACL2, B method, Mizar)

types are a layer on top of an untyped foundation

‘types as predicates’type inference = automated predicate proving

∀x : A.P (x) is syntax for ∀x.A(x) ⇒ P (x)

Page 86: The Next Generation of Proof Assistants

12soft types

◮ no types (Metamath)

◮ hard types (PVS, HOL, Isabelle, Coq, Twelf)

types are part of the foundation

◮ soft types (ACL2, B method, Mizar)

types are a layer on top of an untyped foundation

‘types as predicates’type inference = automated predicate proving

∀x : A(y, . . .). P (x) is syntax for ∀x.A(x, y, . . .) ⇒ P (x)

natural interpretation for dependent types

Page 87: The Next Generation of Proof Assistants

12soft types

◮ no types (Metamath)

◮ hard types (PVS, HOL, Isabelle, Coq, Twelf)

types are part of the foundation

◮ soft types (ACL2, B method, Mizar)

types are a layer on top of an untyped foundation

‘types as predicates’type inference = automated predicate proving

∀x : A(y, . . .). P (x) is syntax for ∀x.A(x, y, . . .) ⇒ P (x)

natural interpretation for dependent typesno natural interpretation for function types A→ B

Page 88: The Next Generation of Proof Assistants

13dependent types and empty types

◮ dependent types

element of a given setelement of a given algebraic structure

array of a given lengthnormal form of a given lambda termvector space of a given dimension

field extension of a given field by a given degree

Page 89: The Next Generation of Proof Assistants

13dependent types and empty types

◮ dependent types

element of a given setelement of a given algebraic structure

array of a given lengthnormal form of a given lambda termvector space of a given dimension

field extension of a given field by a given degree

essential for implicit arguments in notationsx+ y for x+G y when x, y are elements of a group G

Page 90: The Next Generation of Proof Assistants

13dependent types and empty types

◮ dependent types

element of a given setelement of a given algebraic structure

array of a given lengthnormal form of a given lambda termvector space of a given dimension

field extension of a given field by a given degree

essential for implicit arguments in notationsx+ y for x+G y when x, y are elements of a group G

◮ empty types

unavoidable with natural definitions of dependent types

Page 91: The Next Generation of Proof Assistants

13dependent types and empty types

◮ dependent types

element of a given setelement of a given algebraic structure

array of a given lengthnormal form of a given lambda termvector space of a given dimension

field extension of a given field by a given degree

essential for implicit arguments in notationsx+ y for x+G y when x, y are elements of a group G

◮ empty types

unavoidable with natural definitions of dependent types

set → class ↔ type

Page 92: The Next Generation of Proof Assistants

III

should the next generation of proof assistantstake partiality seriously?

Page 93: The Next Generation of Proof Assistants

III

should the next generation of proof assistantstake partiality seriously?

ACL2B method

PVSHOL

IsabelleCoqMizarTwelf

Metamath

Page 94: The Next Generation of Proof Assistants

14the value of

1

0

◮1

0= 0 is provable (ACL2, HOL, Isabelle/HOL, Mizar)

◮1

0= 0 is disprovable (Metamath)

◮1

0= 0 is neither provable nor disprovable (Coq)

◮1

0= 0 is illegal (ACL2/gold, B method, PVS, Coq/CoRN, Twelf)

Page 95: The Next Generation of Proof Assistants

14the value of

1

0

◮1

0= 0 is provable (ACL2, HOL, Isabelle/HOL, Mizar)

◮1

0= 0 is disprovable (Metamath, IMPS)

proof1

0is undefined, 0 is defined qed

◮1

0= 0 is neither provable nor disprovable (Coq)

◮1

0= 0 is illegal (ACL2/gold, B method, PVS, Coq/CoRN, Twelf)

Page 96: The Next Generation of Proof Assistants

14the value of

1

0

◮1

0= 0 is provable (ACL2, HOL, Isabelle/HOL, Mizar)

◮1

0= 0 is disprovable (Metamath, IMPS)

proof1

0is undefined, 0 is defined qed

1

0=

1

0?

◮1

0= 0 is neither provable nor disprovable (Coq)

◮1

0= 0 is illegal (ACL2/gold, B method, PVS, Coq/CoRN, Twelf)

Page 97: The Next Generation of Proof Assistants

14the value of

1

0

◮1

0= 0 is provable (ACL2, HOL, Isabelle/HOL, Mizar)

◮1

0= 0 is disprovable (Metamath, IMPS)

proof1

0is undefined, 0 is defined qed

1

0=

1

0?

◮1

0= 0 is neither provable nor disprovable (Coq)

◮1

0= 0 is illegal (ACL2/gold, B method, PVS, Coq/CoRN, Twelf)

Page 98: The Next Generation of Proof Assistants

14the value of

1

0

◮1

0= 0 is provable (ACL2, HOL, Isabelle/HOL, Mizar)

◮1

0= 0 is disprovable (Metamath, IMPS)

proof1

0is undefined, 0 is defined qed

1

0=

1

0?

◮1

0= 0 is neither provable nor disprovable (Coq)

◮1

0= 0 is illegal (ACL2/gold, B method, PVS, Coq/CoRN, Twelf)

1

x= y

div(1, x, 〈proof object for x 6= 0〉) = y

Page 99: The Next Generation of Proof Assistants

14the value of

1

0

◮1

0= 0 is provable (ACL2, HOL, Isabelle/HOL, Mizar)

◮1

0= 0 is disprovable (Metamath, IMPS)

proof1

0is undefined, 0 is defined qed

1

0=

1

0?

◮1

0= 0 is neither provable nor disprovable (Coq)

◮1

0= 0 is illegal (ACL2/gold, B method, PVS, Coq/CoRN, Twelf)

1

0= 0

div(1, 0, 〈proof object for 0 6= 0〉) = 0

Page 100: The Next Generation of Proof Assistants

14the value of

1

0

◮1

0= 0 is provable (ACL2, HOL, Isabelle/HOL, Mizar)

◮1

0= 0 is disprovable (Metamath, IMPS)

proof1

0is undefined, 0 is defined qed

1

0=

1

0?

◮1

0= 0 is neither provable nor disprovable (Coq)

◮1

0= 0 is illegal (ACL2/gold, B method, PVS, Coq/CoRN, Twelf)

1

0= 0

div(1, 0, 〈proof object for 0 6= 0〉) = 0

Page 101: The Next Generation of Proof Assistants

14the value of

1

0

◮1

0= 0 is provable (ACL2, HOL, Isabelle/HOL, Mizar)

◮1

0= 0 is disprovable (Metamath, IMPS)

proof1

0is undefined, 0 is defined qed

1

0=

1

0?

◮1

0= 0 is neither provable nor disprovable (Coq)

◮1

0= 0 is illegal (ACL2/gold, B method, PVS, Coq/CoRN, Twelf)

1

0= 0

div(1, 0, 〈proof object for 0 6= 0〉) = 0

Page 102: The Next Generation of Proof Assistants

15definedness conditions

each function f(x1, . . . , xn) has a domain predicate Df (x1, . . . , xn)

Ddiv(x, y) ⇔ (y 6= 0)

each formula φ has a definedness condition ∆(φ)

∆(1

0= 0) ⇔ Ddiv(1, 0) ⇔ (0 6= 0) ⇔ ⊥

Page 103: The Next Generation of Proof Assistants

15definedness conditions

each function f(x1, . . . , xn) has a domain predicate Df (x1, . . . , xn)

Ddiv(x, y) ⇔ (y 6= 0)

each formula φ has a definedness condition ∆(φ)

∆(1

0= 0) ⇔ Ddiv(1, 0) ⇔ (0 6= 0) ⇔ ⊥

∆(∀x ∈ R. x 6= 0 ⇒ 1

x6= 0) ?

Page 104: The Next Generation of Proof Assistants

15definedness conditions

each function f(x1, . . . , xn) has a domain predicate Df (x1, . . . , xn)

Ddiv(x, y) ⇔ (y 6= 0)

each formula φ has a definedness condition ∆(φ)

∆(1

0= 0) ⇔ Ddiv(1, 0) ⇔ (0 6= 0) ⇔ ⊥

∆(∀x ∈ R. x 6= 0 ⇒ 1

x6= 0)

∆(φ⇒ ψ) ⇔ (∆(φ) ∧ (φ⇒ ∆(ψ)))

Page 105: The Next Generation of Proof Assistants

15definedness conditions

each function f(x1, . . . , xn) has a domain predicate Df (x1, . . . , xn)

Ddiv(x, y) ⇔ (y 6= 0)

each formula φ has a definedness condition ∆(φ)

∆(1

0= 0) ⇔ Ddiv(1, 0) ⇔ (0 6= 0) ⇔ ⊥

∆(∀x ∈ R. x 6= 0 ⇒ 1

x6= 0)

∆(φ⇒ ψ) ⇔ (∆(φ) ∧ (φ⇒ ∆(ψ)))

∆(φ ∧ ψ) ⇔ (∆(φ) ∧ (φ⇒ ∆(ψ)))

Page 106: The Next Generation of Proof Assistants

15definedness conditions

each function f(x1, . . . , xn) has a domain predicate Df (x1, . . . , xn)

Ddiv(x, y) ⇔ (y 6= 0)

each formula φ has a definedness condition ∆(φ)

∆(1

0= 0) ⇔ Ddiv(1, 0) ⇔ (0 6= 0) ⇔ ⊥

∆(∀x ∈ R. x 6= 0 ⇒ 1

x6= 0)

∆(φ⇒ ψ) ⇔ (∆(φ) ∧ (φ⇒ ∆(ψ)))

∆(φ ∧ ψ) ⇔ (∆(φ) ∧ (φ⇒ ∆(ψ)))

∆ does not respect logical equivalence

∆(φ ∧ ψ) 6⇔ ∆(ψ ∧ φ)

Page 107: The Next Generation of Proof Assistants

IV

should the next generation of proof assistantstake category theory seriously?

Page 108: The Next Generation of Proof Assistants

IV

should the next generation of proof assistantstake category theory seriously?

ACL2B method

PVSHOL

IsabelleCoqMizarTwelf

Metamath

Page 109: The Next Generation of Proof Assistants

16the snake lemma and the category of Abelian groups

��

// •

��

// •

��

// 0

0 // • // • // •

Page 110: The Next Generation of Proof Assistants

16the snake lemma and the category of Abelian groups

��

// •

��

// •

��

// 0

0 // • // • // •

0

��

0

��

0

��•

��

��

��

�� �� ��•��

•��

•��

0 0 0

Page 111: The Next Generation of Proof Assistants

16the snake lemma and the category of Abelian groups

��

// •

��

// •

��

// 0

0 // • // • // •

0

��

0

��

0

��•

��

��

��

�� �� ��•��

•��

•��

0 0 0

• // • // •ED

BC

GF

@A// • // • // •

Page 112: The Next Generation of Proof Assistants

16the snake lemma and the category of Abelian groups

��

// •

��

// •

��

// 0

0 // • // • // •

0

��

0

��

0

��•

��

��

��

�� �� ��•��

•��

•��

0 0 0

• // • // •ED

BC

GF

@A// • // • // •

I don’t like universes!

Page 113: The Next Generation of Proof Assistants

17Vladimir Voevodsky and the formalization of the real numbers

Vladimir Voevodsky, Institute for Advanced StudyFields medal in 2002

Page 114: The Next Generation of Proof Assistants

17Vladimir Voevodsky and the formalization of the real numbers

Vladimir Voevodsky, Institute for Advanced StudyFields medal in 2002

homotopy type theory, 2006

Page 115: The Next Generation of Proof Assistants

17Vladimir Voevodsky and the formalization of the real numbers

Vladimir Voevodsky, Institute for Advanced StudyFields medal in 2002

homotopy type theory, 2006

I will speak about type systems. It is difficult for a mathematician

since a type system is not a mathematical notion.

Page 116: The Next Generation of Proof Assistants

17Vladimir Voevodsky and the formalization of the real numbers

Vladimir Voevodsky, Institute for Advanced StudyFields medal in 2002

homotopy type theory, 2006

I will speak about type systems. It is difficult for a mathematician

since a type system is not a mathematical notion.

R =set of Dedekind cuts?

set of equivalence classes of Cauchy sequences?

Page 117: The Next Generation of Proof Assistants

17Vladimir Voevodsky and the formalization of the real numbers

Vladimir Voevodsky, Institute for Advanced StudyFields medal in 2002

homotopy type theory, 2006

I will speak about type systems. It is difficult for a mathematician

since a type system is not a mathematical notion.

R =set of Dedekind cuts?

set of equivalence classes of Cauchy sequences?set of equivalence classes of pairs of positive real numbers?

Page 118: The Next Generation of Proof Assistants

17Vladimir Voevodsky and the formalization of the real numbers

Vladimir Voevodsky, Institute for Advanced StudyFields medal in 2002

homotopy type theory, 2006

I will speak about type systems. It is difficult for a mathematician

since a type system is not a mathematical notion.

R =set of Dedekind cuts?

set of equivalence classes of Cauchy sequences?set of equivalence classes of pairs of positive real numbers?

any field isomorphic to the real numbers?

Page 119: The Next Generation of Proof Assistants

17Vladimir Voevodsky and the formalization of the real numbers

Vladimir Voevodsky, Institute for Advanced StudyFields medal in 2002

homotopy type theory, 2006

I will speak about type systems. It is difficult for a mathematician

since a type system is not a mathematical notion.

R =set of Dedekind cuts?

set of equivalence classes of Cauchy sequences?set of equivalence classes of pairs of positive real numbers?

any field isomorphic to the real numbers?any set of the cardinality of the real numbers?

Page 120: The Next Generation of Proof Assistants

17Vladimir Voevodsky and the formalization of the real numbers

Vladimir Voevodsky, Institute for Advanced StudyFields medal in 2002

homotopy type theory, 2006

I will speak about type systems. It is difficult for a mathematician

since a type system is not a mathematical notion.

R =set of Dedekind cuts?

set of equivalence classes of Cauchy sequences?set of equivalence classes of pairs of positive real numbers?

any field isomorphic to the real numbers?any set of the cardinality of the real numbers?

abstract datatypes in mathematics?

Page 121: The Next Generation of Proof Assistants

17Vladimir Voevodsky and the formalization of the real numbers

Vladimir Voevodsky, Institute for Advanced StudyFields medal in 2002

homotopy type theory, 2006

I will speak about type systems. It is difficult for a mathematician

since a type system is not a mathematical notion.

R =set of Dedekind cuts?

set of equivalence classes of Cauchy sequences?set of equivalence classes of pairs of positive real numbers?

any field isomorphic to the real numbers?any set of the cardinality of the real numbers?

abstract datatypes in mathematics?hardwire ‘up to isomorphism’ in the logical foundations?

Page 122: The Next Generation of Proof Assistants

V

should the next generation of proof assistantsbe based on a logical framework?

Page 123: The Next Generation of Proof Assistants

V

should the next generation of proof assistantsbe based on a logical framework?

ACL2B method

PVSHOL

IsabelleCoqMizarTwelf

Metamath

Page 124: The Next Generation of Proof Assistants

18logical frameworks

◮ Twelf = LFminimal type theory

◮ Isabelle/Pureminimal higher order logic

◮ Metamathminimal string manipulation

Page 125: The Next Generation of Proof Assistants

18logical frameworks

◮ Twelf = LFminimal type theory

◮ Isabelle/Pureminimal higher order logic

◮ Metamathminimal string manipulationnot HOAS: not invariant under variable renaming

Page 126: The Next Generation of Proof Assistants

18logical frameworks

◮ Twelf = LFminimal type theory

◮ Isabelle/Pureminimal higher order logic

◮ Metamathminimal string manipulationnot HOAS: not invariant under variable renaming

◮ Automath = AUT-SL = ∆ΛN.G. de Bruijn, Eindhoven University of Technology, 1987very similar to LF but more elegant

Page 127: The Next Generation of Proof Assistants

18logical frameworks

◮ Twelf = LFminimal type theory

◮ Isabelle/Pureminimal higher order logic

◮ Metamathminimal string manipulationnot HOAS: not invariant under variable renaming

◮ Automath = AUT-SL = ∆ΛN.G. de Bruijn, Eindhoven University of Technology, 1987very similar to LF but more elegant

◮ ∆Λ with a bounded conversion rule?

Page 128: The Next Generation of Proof Assistants

19reasons for using a logical framework

◮ varying the logictaking Godel’s incompleteness theorem seriouslytracking what is used in a proof

classical logic?K axiom about equality of equality proofs?

axiom of choice?large cardinal axioms?

Hilbert’s ǫ choice operator?universes?

Page 129: The Next Generation of Proof Assistants

19reasons for using a logical framework

◮ varying the logictaking Godel’s incompleteness theorem seriouslytracking what is used in a proof

classical logic?K axiom about equality of equality proofs?

axiom of choice?large cardinal axioms?

Hilbert’s ǫ choice operator?universes?

◮ simplifying the logical kernelDNA of formal mathematics

Page 130: The Next Generation of Proof Assistants

19reasons for using a logical framework

◮ varying the logictaking Godel’s incompleteness theorem seriouslytracking what is used in a proof

classical logic?K axiom about equality of equality proofs?

axiom of choice?large cardinal axioms?

Hilbert’s ǫ choice operator?universes?

◮ simplifying the logical kernelDNA of formal mathematics

∆Λ ‘term’ = directed graph with four kinds of nodesout-degrees: 2, 2, 1, 0

Page 131: The Next Generation of Proof Assistants

VI

should the next generation of proof assistantshave a self-verified kernel?

Page 132: The Next Generation of Proof Assistants

VI

should the next generation of proof assistantshave a self-verified kernel?

ACL2B method

PVSHOL

IsabelleCoqMizarTwelf

Metamath

Page 133: The Next Generation of Proof Assistants

20state of the art in self-verification

◮ Coq in Coq = CocBruno Barras, Universite Paris 7, 1999

version of Coq kernel as a Coq program, extracted to OCamlnot close to Coq source, can check proofs from real Coq

Page 134: The Next Generation of Proof Assistants

20state of the art in self-verification

◮ Coq in Coq = CocBruno Barras, Universite Paris 7, 1999

version of Coq kernel as a Coq program, extracted to OCamlnot close to Coq source, can check proofs from real Coq

◮ HOL in HOLJohn Harrison, Intel, 2006

simplified HOL kernel as a HOL programvery close to HOL source, cannot check HOL proofs

Page 135: The Next Generation of Proof Assistants

20state of the art in self-verification

◮ Coq in Coq = CocBruno Barras, Universite Paris 7, 1999

version of Coq kernel as a Coq program, extracted to OCamlnot close to Coq source, can check proofs from real Coq

◮ HOL in HOLJohn Harrison, Intel, 2006

simplified HOL kernel as a HOL programvery close to HOL source, cannot check HOL proofs

◮ ACL2 in ACL2 = MilawaJared Davis, University of Texas, 2009

various approximations to ACL2 as an ACL2 programnot close to ACL2 source, can check proofs from real ACL2

Page 136: The Next Generation of Proof Assistants

21the philosophy of certainty

◮ reliability of hardware and software infrastructure?

Page 137: The Next Generation of Proof Assistants

21the philosophy of certainty

◮ reliability of hardware and software infrastructure?

◮ how can a system validate itself?

if it is incorrect it can falsely claim to be correct

Page 138: The Next Generation of Proof Assistants

21the philosophy of certainty

◮ reliability of hardware and software infrastructure?

◮ how can a system validate itself?

if it is incorrect it can falsely claim to be correct

◮ Godel’s second incompleteness theorem?no consistent logical system can prove its own consistency

Page 139: The Next Generation of Proof Assistants

21the philosophy of certainty

◮ reliability of hardware and software infrastructure?

◮ how can a system validate itself?

if it is incorrect it can falsely claim to be correct

◮ Godel’s second incompleteness theorem?no consistent logical system can prove its own consistency

not: system cannot prove falsebut: system implements logic

Page 140: The Next Generation of Proof Assistants

21the philosophy of certainty

◮ reliability of hardware and software infrastructure?

◮ how can a system validate itself?

if it is incorrect it can falsely claim to be correct

◮ Godel’s second incompleteness theorem?no consistent logical system can prove its own consistency

not: system cannot prove falsebut: system implements logic

just one additional line

logic cannot prove false ⊢ system cannot prove false

Page 141: The Next Generation of Proof Assistants

21the philosophy of certainty

◮ reliability of hardware and software infrastructure?

◮ how can a system validate itself?

if it is incorrect it can falsely claim to be correct

◮ Godel’s second incompleteness theorem?no consistent logical system can prove its own consistency

not: system cannot prove falsebut: system implements logic

just one additional line

logic has a model ⊢ system cannot prove false

Page 142: The Next Generation of Proof Assistants

21the philosophy of certainty

◮ reliability of hardware and software infrastructure?

◮ how can a system validate itself?

if it is incorrect it can falsely claim to be correct

◮ Godel’s second incompleteness theorem?no consistent logical system can prove its own consistency

not: system cannot prove falsebut: system implements logic

just one additional line

inaccessible cardinal axiom ⊢ system cannot prove false

Page 143: The Next Generation of Proof Assistants

VII

should the next generation of proof assistantsbe programmed in itself?

Page 144: The Next Generation of Proof Assistants

VII

should the next generation of proof assistantsbe programmed in itself?

ACL2B method

PVSHOL

IsabelleCoqMizarTwelf

Metamath

Page 145: The Next Generation of Proof Assistants

22languages in proof assistants

◮ implementation languagelanguage the implementer uses to implement the system

Page 146: The Next Generation of Proof Assistants

22languages in proof assistants

◮ implementation languagelanguage the implementer uses to implement the system

◮ scripting languagelanguage the user uses to automate proofs in the system

Page 147: The Next Generation of Proof Assistants

22languages in proof assistants

◮ implementation languagelanguage the implementer uses to implement the system

◮ scripting languagelanguage the user uses to automate proofs in the system

◮ mathematical languagelanguage the user uses to write mathematics

Page 148: The Next Generation of Proof Assistants

22languages in proof assistants

◮ implementation languagelanguage the implementer uses to implement the system

◮ scripting languagelanguage the user uses to automate proofs in the system

◮ mathematical languagelanguage the user uses to write mathematics. . . and mathematical algorithms

Page 149: The Next Generation of Proof Assistants

22languages in proof assistants

◮ implementation languagelanguage the implementer uses to implement the system

Coq: OCaml

◮ scripting languagelanguage the user uses to automate proofs in the system

◮ mathematical languagelanguage the user uses to write mathematics. . . and mathematical algorithms

Page 150: The Next Generation of Proof Assistants

22languages in proof assistants

◮ implementation languagelanguage the implementer uses to implement the system

Coq: OCaml

◮ scripting languagelanguage the user uses to automate proofs in the system

Coq: Ltac

◮ mathematical languagelanguage the user uses to write mathematics. . . and mathematical algorithms

Page 151: The Next Generation of Proof Assistants

22languages in proof assistants

◮ implementation languagelanguage the implementer uses to implement the system

Coq: OCaml

◮ scripting languagelanguage the user uses to automate proofs in the system

Coq: Ltac

◮ mathematical languagelanguage the user uses to write mathematics. . . and mathematical algorithms

Coq: Gallina

Page 152: The Next Generation of Proof Assistants

22languages in proof assistants

◮ implementation languagelanguage the implementer uses to implement the system

Coq: OCaml

◮ scripting languagelanguage the user uses to automate proofs in the system

Coq: Ltac

◮ mathematical languagelanguage the user uses to write mathematics. . . and mathematical algorithms

Coq: Gallina

OCaml, Ltac, Gallina: three very similar programming languages

Page 153: The Next Generation of Proof Assistants

22languages in proof assistants

◮ implementation languagelanguage the implementer uses to implement the system

Coq: OCaml

◮ scripting languagelanguage the user uses to automate proofs in the system

Coq: Ltac

◮ mathematical languagelanguage the user uses to write mathematics. . . and mathematical algorithms

Coq: Gallina, Program

OCaml, Ltac, Gallina, Program: four similar programming languages

Page 154: The Next Generation of Proof Assistants

23programming language versus mathematical language

◮ type theory:

mathematical language∩

programming language

mathematical functions = terminating programs

Page 155: The Next Generation of Proof Assistants

23programming language versus mathematical language

◮ type theory:

mathematical language∩

programming language

mathematical functions = terminating programs

◮ better:

programming language∩

mathematical language

programs = executable function definitions

Page 156: The Next Generation of Proof Assistants

24the mathematical function versus the executable object

all actual computers are finite state machines

Page 157: The Next Generation of Proof Assistants

24the mathematical function versus the executable object

all actual computers are finite state machines

let rec fac n = if n=0 then 1 else n*(fac(n-1));;

Page 158: The Next Generation of Proof Assistants

24the mathematical function versus the executable object

all actual computers are finite state machines

let rec fac n = if n=0 then 1 else n*(fac(n-1));;

��

mathematical function

&

theorem aboutthe definition of the

mathematical function

fac : Z≥0 → Z

Page 159: The Next Generation of Proof Assistants

24the mathematical function versus the executable object

all actual computers are finite state machines

let rec fac n = if n=0 then 1 else n*(fac(n-1));;

��

mathematical function

&

theorem aboutthe definition of the

mathematical function

fac : Z≥0 → Z

@@R

executable object

2 ACC0

3 BNEQ 0, 9

6 CONST1

7 RETURN 1

9 ACC0

10 OFFSETINT -1

12 PUSHOFFSETCLOSURE0

13 APPLY1

14 PUSHACC1

15 MULINT

16 RETURN 1

Page 160: The Next Generation of Proof Assistants

24the mathematical function versus the executable object

all actual computers are finite state machines

let rec fac n = if n=0 then 1 else n*(fac(n-1));;

��

mathematical function

&

theorem aboutthe definition of the

mathematical function

fac : Z≥0 → Z

@@R

executable object

2 ACC0

3 BNEQ 0, 9

6 CONST1

7 RETURN 1

9 ACC0

10 OFFSETINT -1

12 PUSHOFFSETCLOSURE0

13 APPLY1

14 PUSHACC1

15 MULINT

16 RETURN 1

?theorem about the relation between the two

Page 161: The Next Generation of Proof Assistants

VIII

should the next generation of proof assistantsbe competitive with commercial computer algebra?

Page 162: The Next Generation of Proof Assistants

VIII

should the next generation of proof assistantsbe competitive with commercial computer algebra?

ACL2B method

PVSHOL

IsabelleCoqMizarTwelf

Metamath

Page 163: The Next Generation of Proof Assistants

25the reliability of computer algebra systems

> 2*infinity-infinity;

Page 164: The Next Generation of Proof Assistants

25the reliability of computer algebra systems

> 2*infinity-infinity;

undefined

Page 165: The Next Generation of Proof Assistants

25the reliability of computer algebra systems

> 2*infinity-infinity, 2*x-x;

undefined, x

Page 166: The Next Generation of Proof Assistants

25the reliability of computer algebra systems

> 2*infinity-infinity, 2*x-x;

undefined, x

> subs(x=infinity, 2*x-x);

infinity

Page 167: The Next Generation of Proof Assistants

25the reliability of computer algebra systems

> 2*infinity-infinity, 2*x-x;

undefined, x

> subs(x=infinity, 2*x-x);

infinity

> 1/(1-x) = simplify(1/(1-x))

1

1 − x= − 1

−1 + x

Page 168: The Next Generation of Proof Assistants

25the reliability of computer algebra systems

> 2*infinity-infinity, 2*x-x;

undefined, x

> subs(x=infinity, 2*x-x);

infinity

> int(1/(1-x),x) = int(simplify(1/(1-x)),x);

− ln(1 − x) = − ln(−1 + x)

Page 169: The Next Generation of Proof Assistants

25the reliability of computer algebra systems

> 2*infinity-infinity, 2*x-x;

undefined, x

> subs(x=infinity, 2*x-x);

infinity

> int(1/(1-x),x) = int(simplify(1/(1-x)),x);

− ln(1 − x) = − ln(−1 + x)

> evalf(subs(x=-1, %));

−0.6931471806 = −0.6931471806 − 3.141592654i

Page 170: The Next Generation of Proof Assistants

26killer app for proof assistants?

◮ reliable software and hardware development

Page 171: The Next Generation of Proof Assistants

26killer app for proof assistants?

◮ reliable software and hardware development

◮ mathematics education

teaching students about mathematical proofChristophe Rafalli, Universite de Savoie, 2002

Page 172: The Next Generation of Proof Assistants

26killer app for proof assistants?

◮ reliable software and hardware development

◮ mathematics education

teaching students about mathematical proofChristophe Rafalli, Universite de Savoie, 2002

◮ mathematically sound computer algebra

Page 173: The Next Generation of Proof Assistants

26killer app for proof assistants?

◮ reliable software and hardware development

◮ mathematics education

teaching students about mathematical proofChristophe Rafalli, Universite de Savoie, 2002

◮ mathematically sound computer algebra

performance? features?

Page 174: The Next Generation of Proof Assistants

26killer app for proof assistants?

◮ reliable software and hardware development

◮ mathematics education

teaching students about mathematical proofChristophe Rafalli, Universite de Savoie, 2002

◮ mathematically sound computer algebra

performance? features?

computers cannot do high school mathematics

x 6= 0 ∧∣

∣ ln |x|∣

∣ > 2 ∧∫ |x|

0t dt ≤ 1 ⇒ − 1

e2< x <

1

e2

Page 175: The Next Generation of Proof Assistants

26killer app for proof assistants?

◮ reliable software and hardware development

◮ mathematics education

teaching students about mathematical proofChristophe Rafalli, Universite de Savoie, 2002

◮ mathematically sound computer algebra

performance? features?

computers cannot do high school mathematics yet

x 6= 0 ∧∣

∣ ln |x|∣

∣ > 2 ∧∫ |x|

0t dt ≤ 1 ⇒ − 1

e2< x <

1

e2

Page 176: The Next Generation of Proof Assistants

IX

should the next generation of proof assistantsuse a declarative proof style?

Page 177: The Next Generation of Proof Assistants

IX

should the next generation of proof assistantsuse a declarative proof style?

ACL2B method

PVSHOL

IsabelleCoqMizarTwelf

Metamath

Page 178: The Next Generation of Proof Assistants

27proof styles in proof assistants

◮ tactic scripts (HOL, Isabelle, Coq, PVS, B method, Metamath)

procedural

◮ controlled natural language (Mizar, Isabelle/Isar, Twelf)

declarative

◮ generated natural language (ACL2)

◮ actual natural language

Page 179: The Next Generation of Proof Assistants

27proof styles in proof assistants

◮ tactic scripts (HOL, Isabelle, Coq, PVS, B method, Metamath)

procedural

◮ controlled natural language (Mizar, Isabelle/Isar, Twelf)

declarative

◮ generated natural language (ACL2)

◮ actual natural language

‘computer should be able to parse mathematical LATEX’

Page 180: The Next Generation of Proof Assistants

27proof styles in proof assistants

◮ tactic scripts (HOL, Isabelle, Coq, PVS, B method, Metamath)

procedural

◮ controlled natural language (Mizar, Isabelle/Isar, Twelf)

declarative

◮ generated natural language (ACL2)

◮ actual natural language (not practically possible)

‘computer should be able to parse mathematical LATEX’

Page 181: The Next Generation of Proof Assistants

27proof styles in proof assistants

◮ tactic scripts (HOL, Isabelle, Coq, PVS, B method, Metamath)

proceduralonly understandable by interactively replaying the proof

◮ controlled natural language (Mizar, Isabelle/Isar, Twelf)

declarative

◮ generated natural language (ACL2)

◮ actual natural language (not practically possible)

‘computer should be able to parse mathematical LATEX’

Page 182: The Next Generation of Proof Assistants

27proof styles in proof assistants

◮ tactic scripts (HOL, Isabelle, Coq, PVS, B method, Metamath)

proceduralonly understandable by interactively replaying the proof

◮ controlled natural language (Mizar, Isabelle/Isar, Twelf)

declarativesimilar in look to programming language

◮ generated natural language (ACL2)

◮ actual natural language (not practically possible)

‘computer should be able to parse mathematical LATEX’

Page 183: The Next Generation of Proof Assistants

27proof styles in proof assistants

◮ tactic scripts (HOL, Isabelle, Coq, PVS, B method, Metamath)

proceduralonly understandable by interactively replaying the proof

◮ controlled natural language (Mizar, Isabelle/Isar, Twelf)

declarativesimilar in look to programming language

◮ generated natural language (ACL2)

◮ actual natural language (not practically possible)

‘computer should be able to parse mathematical LATEX’

Page 184: The Next Generation of Proof Assistants

27proof styles in proof assistants

◮ tactic scripts (HOL, Isabelle, Coq, PVS, B method, Metamath)

proceduralonly understandable by interactively replaying the proof

◮ controlled natural language (Mizar, Isabelle/Isar, Twelf)

declarativesimilar in look to programming language

◮ generated natural language (ACL2)

rather verbose: screens and screens of text

◮ actual natural language (not practically possible)

‘computer should be able to parse mathematical LATEX’

Page 185: The Next Generation of Proof Assistants

27proof styles in proof assistants

◮ tactic scripts (HOL, Isabelle, Coq, PVS, B method, Metamath)

proceduralonly understandable by interactively replaying the proof

◮ controlled natural language (Mizar, Isabelle/Isar, Twelf)

declarativesimilar in look to programming language

◮ generated natural language (ACL2, Theorema)

rather verbose: screens and screens of text

◮ actual natural language (not practically possible)

‘computer should be able to parse mathematical LATEX’

Page 186: The Next Generation of Proof Assistants

28Mohan Ganesalingam and the language of mathematics

Mohan Ganesalingam, University of Cambridgesenior wrangler of his year

The Language of Mathematics, 2009277 page master’s thesis → PhD thesis

articficial language as close as possible to actual language

Page 187: The Next Generation of Proof Assistants

28Mohan Ganesalingam and the language of mathematics

Mohan Ganesalingam, University of Cambridgesenior wrangler of his year

The Language of Mathematics, 2009277 page master’s thesis → PhD thesis

articficial language as close as possible to actual language

Andrzej Trybulec, MizarMakarius Wenzel, Isabelle/IsarAndriy Paskevych, SAD/ForTheL

Page 188: The Next Generation of Proof Assistants

28Mohan Ganesalingam and the language of mathematics

Mohan Ganesalingam, University of Cambridgesenior wrangler of his year

The Language of Mathematics, 2009277 page master’s thesis → PhD thesis

articficial language as close as possible to actual language

Andrzej Trybulec, MizarMakarius Wenzel, Isabelle/IsarAndriy Paskevych, SAD/ForTheL (= ‘Evidence Algorithm’)

Page 189: The Next Generation of Proof Assistants

28Mohan Ganesalingam and the language of mathematics

Mohan Ganesalingam, University of Cambridgesenior wrangler of his year

The Language of Mathematics, 2009277 page master’s thesis → PhD thesis

articficial language as close as possible to actual language

Andrzej Trybulec, MizarMakarius Wenzel, Isabelle/IsarAndriy Paskevych, SAD/ForTheL (= ‘Evidence Algorithm’)

Steven Kieffer, A language for mathematical knowledge management

Peter Koepke, Naturalness in formal mathematics

Claus Zinn, Understanding Informal Mathematical Discourse

Aarne Ranta, Syntactic categories in the language of mathematics

Page 190: The Next Generation of Proof Assistants

29formal proof sketches

Theorem 43 (Pythagoras’ theorem).√

2 is irrational.

The traditional proof ascribed to Pythagoras runs as follows.If√

2 is rational, then the equation

a2 = 2b2 (4.3.1)

is soluble in integers a, b with (a, b) = 1. Hence a2 is even, andtherefore a is even. If a = 2c, then 4c2 = 2b2, 2c2 = b2, andb is also even, contrary to the hypothesis that (a, b) = 1. �

Page 191: The Next Generation of Proof Assistants

29formal proof sketches

theorem :: Pythagoras’ theorem

Th43: sqrt 2 is irrationalproof:: the traditional proof ascribed to Pythagoras :

assume sqrt 2 is rational;consider a, b such that

4 3 1: aˆ2 = 2 ∗ bˆ2 anda,b are relative prime;

then aˆ2 is even;then a is even;consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

Page 192: The Next Generation of Proof Assistants

29formal proof sketches

theoremTh43: sqrt 2 is irrational

proof:: the traditional proof ascribed to Pythagoras :

assume sqrt 2 is rational;consider a, b such that

4 3 1: aˆ2 = 2 ∗ bˆ2 anda,b are relative prime;

then aˆ2 is even;then a is even;consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

:: (Pythagoras’ theorem)

Page 193: The Next Generation of Proof Assistants

29formal proof sketches

proof:: the traditional proof ascribed to Pythagoras :

assume sqrt 2 is rational;consider a, b such that

4 3 1: aˆ2 = 2 ∗ bˆ2 anda,b are relative prime;

then aˆ2 is even;then a is even;consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

Page 194: The Next Generation of Proof Assistants

29formal proof sketches

assume sqrt 2 is rational;consider a, b such that

4 3 1: aˆ2 = 2 ∗ bˆ2 anda,b are relative prime;

then aˆ2 is even;then a is even;consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :

Page 195: The Next Generation of Proof Assistants

29formal proof sketches

consider a, b such that4 3 1: aˆ2 = 2 ∗ bˆ2 and

a,b are relative prime;then aˆ2 is even;then a is even;consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational;

Page 196: The Next Generation of Proof Assistants

29formal proof sketches

4 3 1: aˆ2 = 2 ∗ bˆ2 anda,b are relative prime;

then aˆ2 is even;then a is even;consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

Page 197: The Next Generation of Proof Assistants

29formal proof sketches

aˆ2 = 2 ∗ bˆ2 anda,b are relative prime;

then aˆ2 is even;then a is even;consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 :

Page 198: The Next Generation of Proof Assistants

29formal proof sketches

anda,b are relative prime;

then aˆ2 is even;then a is even;consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

Page 199: The Next Generation of Proof Assistants

29formal proof sketches

a,b are relative prime;then aˆ2 is even;then a is even;consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

and

Page 200: The Next Generation of Proof Assistants

29formal proof sketches

then aˆ2 is even;then a is even;consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

and a, b are relative prime;

Page 201: The Next Generation of Proof Assistants

29formal proof sketches

then a is even;consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

and a, b are relative prime; then aˆ2 is even;

Page 202: The Next Generation of Proof Assistants

29formal proof sketches

consider c such that a = 2 ∗ c;then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

and a, b are relative prime; then aˆ2 is even; then a is even;

Page 203: The Next Generation of Proof Assistants

29formal proof sketches

then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

and a, b are relative prime; then aˆ2 is even; then a is even;consider c such that a = 2 ∗ c;

Page 204: The Next Generation of Proof Assistants

29formal proof sketches

2 ∗ cˆ2 = bˆ2;b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

and a, b are relative prime; then aˆ2 is even; then a is even;consider c such that a = 2 ∗ c; then 4 ∗ cˆ2 = 2 ∗ bˆ2;

Page 205: The Next Generation of Proof Assistants

29formal proof sketches

b is even;hence contradiction;

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

and a, b are relative prime; then aˆ2 is even; then a is even;consider c such that a = 2 ∗ c; then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2;

Page 206: The Next Generation of Proof Assistants

29formal proof sketches

hence contradiction;end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

and a, b are relative prime; then aˆ2 is even; then a is even;consider c such that a = 2 ∗ c; then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2; b is even;

Page 207: The Next Generation of Proof Assistants

29formal proof sketches

end;

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

and a, b are relative prime; then aˆ2 is even; then a is even;consider c such that a = 2 ∗ c; then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2; b is even; hence contradiction;

Page 208: The Next Generation of Proof Assistants

29formal proof sketches

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

and a, b are relative prime; then aˆ2 is even; then a is even;consider c such that a = 2 ∗ c; then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2; b is even; hence contradiction; end;

Page 209: The Next Generation of Proof Assistants

29formal proof sketches

Theorem 43 (Pythagoras’ theorem).√

2 is irrational.

The traditional proof ascribed to Pythagoras runs as follows.If√

2 is rational, then the equation

a2 = 2b2 (4.3.1)

is soluble in integers a, b with (a, b) = 1. Hence a2 is even, andtherefore a is even. If a = 2c, then 4c2 = 2b2, 2c2 = b2, andb is also even, contrary to the hypothesis that (a, b) = 1. �

Page 210: The Next Generation of Proof Assistants

29formal proof sketches

Theorem 43 (Pythagoras’ theorem).√

2 is irrational.

The traditional proof ascribed to Pythagoras runs as follows.If√

2 is rational, then the equation

a2 = 2b2 (4.3.1)

is soluble in integers a, b with (a, b) = 1. Hence a2 is even, andtherefore a is even. If a = 2c, then 4c2 = 2b2, 2c2 = b2, andb is also even, contrary to the hypothesis that (a, b) = 1. �

Page 211: The Next Generation of Proof Assistants

29formal proof sketches

theorem Th43: sqrt 2 is irrational :: (Pythagoras’ theorem)

proof :: the traditional proof ascribed to Pythagoras :assume sqrt 2 is rational; consider a, b such that

4 3 1 : aˆ2 = 2 ∗ bˆ2

and a, b are relative prime; then aˆ2 is even; then a is even;consider c such that a = 2 ∗ c; then 4 ∗ cˆ2 = 2 ∗ bˆ2;2 ∗ cˆ2 = bˆ2; b is even; hence contradiction; end;

Page 212: The Next Generation of Proof Assistants

30integrating the procedural and declarative proof styles

Freek Wiedijk, Radboud University Nijmegen, 2009

Mizar Light =Mizar proof language on top of HOL Light system

Page 213: The Next Generation of Proof Assistants

30integrating the procedural and declarative proof styles

Freek Wiedijk, Radboud University Nijmegen, 2009

Mizar Light =Mizar proof language on top of HOL Light system

three ways to create Mizar Light texts

◮ editing manually = declarative proof style

◮ growing by executing tactics = procedural proof style

Page 214: The Next Generation of Proof Assistants

30integrating the procedural and declarative proof styles

Freek Wiedijk, Radboud University Nijmegen, 2009

Mizar Light =Mizar proof language on top of HOL Light system

three ways to create Mizar Light texts

◮ editing manually = declarative proof style

check-fix-extend cycle

◮ growing by executing tactics = procedural proof style

Page 215: The Next Generation of Proof Assistants

30integrating the procedural and declarative proof styles

Freek Wiedijk, Radboud University Nijmegen, 2009

Mizar Light =Mizar proof language on top of HOL Light system

three ways to create Mizar Light texts

◮ editing manually = declarative proof style

check-fix-extend cycle

◮ growing by executing tactics = procedural proof style

lines without correct justification are the subgoals

Page 216: The Next Generation of Proof Assistants

30integrating the procedural and declarative proof styles

Freek Wiedijk, Radboud University Nijmegen, 2009

Mizar Light =Mizar proof language on top of HOL Light system

three ways to create Mizar Light texts

◮ editing manually = declarative proof style

check-fix-extend cycle

◮ growing by executing tactics = procedural proof style

lines without correct justification are the subgoals

◮ converting existing HOL Light scripts

Page 217: The Next Generation of Proof Assistants

X

how should the next generation of proof assistantsbe arrived at?

Page 218: The Next Generation of Proof Assistants

31evolution versus revolution

◮ next generation of an existing system?

◮ new system from scratch?

Page 219: The Next Generation of Proof Assistants

31evolution versus revolution

◮ next generation of an existing system?

HOL Light → Mizar Light was an attempt at this

◮ new system from scratch?

Page 220: The Next Generation of Proof Assistants

31evolution versus revolution

◮ next generation of an existing system?

HOL Light → Mizar Light was an attempt at this

best starting points = systems that answered ‘yes’ most

Isabelle

Coq

◮ new system from scratch?

Page 221: The Next Generation of Proof Assistants

31evolution versus revolution

◮ next generation of an existing system?

HOL Light → Mizar Light was an attempt at this

best starting points = systems that answered ‘yes’ most

Isabelle

Coq

◮ new system from scratch?

throw away all that existing work?

Page 222: The Next Generation of Proof Assistants

31evolution versus revolution

◮ next generation of an existing system?

HOL Light → Mizar Light was an attempt at this

best starting points = systems that answered ‘yes’ most

Isabelle

Coq

◮ new system from scratch?

throw away all that existing work?

many interoperable systems, or let the best system win?

Page 223: The Next Generation of Proof Assistants

31evolution versus revolution

◮ next generation of an existing system?

HOL Light → Mizar Light was an attempt at this

best starting points = systems that answered ‘yes’ most

Isabelle

Coq

◮ new system from scratch?

throw away all that existing work?

many interoperable systems, or let the best system win!

Page 224: The Next Generation of Proof Assistants

the three bottlenecks

Page 225: The Next Generation of Proof Assistants

32main improvements needed for wide adaptation of proof assistants

◮ better automation

◮ better mathematical libraries

◮ better match with existing mathematical culture

Page 226: The Next Generation of Proof Assistants

32main improvements needed for wide adaptation of proof assistants

◮ better automation

◮ better mathematical libraries

◮ better match with existing mathematical culture

◮ better visual reasoning

Page 227: The Next Generation of Proof Assistants

32main improvements needed for wide adaptation of proof assistants

◮ better automation

◮ better mathematical libraries

◮ better match with existing mathematical culture

◮ better visual reasoning

theorem arctan1

2+ arctan

1

3=π

4proof

Page 228: The Next Generation of Proof Assistants

32main improvements needed for wide adaptation of proof assistants

◮ better automation

◮ better mathematical libraries

◮ better match with existing mathematical culture

◮ better visual reasoning

theorem arctan1

2+ arctan

1

3=π

4proof

> simplify(arctan(1/2) + arctan(1/3) - Pi/4);

Page 229: The Next Generation of Proof Assistants

32main improvements needed for wide adaptation of proof assistants

◮ better automation

◮ better mathematical libraries

◮ better match with existing mathematical culture

◮ better visual reasoning

theorem arctan1

2+ arctan

1

3=π

4proof

> simplify(arctan(1/2) + arctan(1/3) - Pi/4);

0

Page 230: The Next Generation of Proof Assistants

32main improvements needed for wide adaptation of proof assistants

◮ better automation

◮ better mathematical libraries

◮ better match with existing mathematical culture

◮ better visual reasoning

theorem arctan1

2+ arctan

1

3=π

4proof

Page 231: The Next Generation of Proof Assistants

32main improvements needed for wide adaptation of proof assistants

◮ better automation

◮ better mathematical libraries

◮ better match with existing mathematical culture

◮ better visual reasoning

theorem arctan1

2+ arctan

1

3=π

4proof

Page 232: The Next Generation of Proof Assistants

32main improvements needed for wide adaptation of proof assistants

◮ better automation

◮ better mathematical libraries

◮ better match with existing mathematical culture

◮ better visual reasoning

theorem arctan1

2+ arctan

1

3=π

4proof

Page 233: The Next Generation of Proof Assistants

32main improvements needed for wide adaptation of proof assistants

◮ better automation

◮ better mathematical libraries

◮ better match with existing mathematical culture

◮ better visual reasoning

theorem arctan1

2+ arctan

1

3=π

4proof

Page 234: The Next Generation of Proof Assistants

32main improvements needed for wide adaptation of proof assistants

◮ better automation

◮ better mathematical libraries

◮ better match with existing mathematical culture

◮ better visual reasoning

theorem arctan1

2+ arctan

1

3=π

4proof