The Coq Proof Assistant

Size: px
Start display at page:

Download "The Coq Proof Assistant"

Transcription

1 The Coq Proof Assistant Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan October 15, 2018 Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

2 Outline 1 The Coq Proof Assistant Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

3 The Coq Proof Assistant Coq is a proof assistant which checks every proof steps. It has been developed by Institut national de recherche en informatique et en automatique (INRIA) at France since It is used to check the proofs of the four color theorem (September 2004) and Feit-Thompson theorem (September 2012). It is also used in the CompCert project to formally verify an optimizing C compiler for PowerPC, ARM, and 32-bit x86 processors (2005). Coq is available on various platforms. The contents of this lecture are borrowed from Coq Tutorial. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

4 Using Coq We start up and exit Coq as follows. $ coqtop Welcome to Coq 8.3 pl4 ( April 2012) Coq < Quit. $ Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

5 Prop, Set, and Type A sort classifies specifications. a logical proposition has the sort Prop; a mathematical collection has the sort Set; and an abstract type has the sort Type. Every Coq expression has a sort. Coq < Check False. False : Prop Coq < Check nat. nat : Set Coq < Check O. 0 : nat Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

6 Basic Proof Tactics I Let us do some simple proofs. We first set up our context. Coq < Section Simple. Coq < Hypothesis P Q : Prop. P is assumed Q is assumed In this code, we start a section called Simple. We also make two hypotheses. Both P and Q are logical propositions. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

7 Basic Proof Tactics II We first show P P. Coq < Lemma one_ line : P -> P. P : Prop Q : Prop P -> P We declare a lemma called one line. Coq asks us to show P P from the hypotheses P and Q. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

8 Basic Proof Tactics III The tactic intros introduces new hypotheses with the given name. one_ line < intros HP. P : Prop Q : Prop HP : P P How does intros compare to the i rule? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

9 Basic Proof Tactics IV The tactic exact uses the named hypothesis. one_ line < exact HP. Proof completed. The command Qed finishes up the lemma. one_ line < Qed. intros HP. exact HP. one_ line is defined Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

10 Basic Proof Tactics V We can check our new lemma and print its proof. Coq < Check one_ line. one_ line : P -> P Coq < Print one_ line. one_ line = fun HP : P => HP : P -> P Observe how our proof is represented in Coq. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

11 Basic Proof Tactics VI Tactics start with lowercase letters such as intros and exact. We use tactics to construct formal proofs. Commands on the other hand start with uppercase letters such as Quit, Section, Lemma, Qed, Print. We use commands to operate Coq. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

12 Basic Proof Tactics VII Let us prove P (P Q) Q. Coq < Lemma MP : P -> ( P -> Q) -> Q. P : Prop Q : Prop P -> (P -> Q) -> Q MP < intros HP HI. P : Prop Q : Prop HP : P HI : P -> Q Q Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

13 Basic Proof Tactics VIII The tactic apply matches the conclusion with the named hypothesis and lists unresolved conditions. MP < apply HI. P : Prop Q : Prop HP : P HI : P -> Q P MP < exact HP. Proof completed. How does apply compare to e? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

14 Basic Proof Tactics IX Let us finish up the lemma and see the proof term. MP < Qed. intros HP HI. apply HI. exact HP. MP is defined Coq < Print MP. MP = fun ( HP : P) ( HI : P -> Q) => HI HP : P -> (P -> Q) -> Q Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

15 Basic Proof Tactics X Let us prove P Q Q P. Coq < Lemma conj_ comm : P /\ Q -> Q /\ P. P : Prop Q : Prop P /\ Q -> Q /\ P conj_ comm < intros conj. P : Prop Q : Prop conj : P /\ Q Q /\ P Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

16 Basic Proof Tactics XI The tactic elim eliminates a named hypothesis. conj_ comm < elim conj. P : Prop Q : Prop conj : P /\ Q P -> Q -> Q /\ P Observe that P Q is decomposed into P and Q. How does elim compare to e 1 and e 2? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

17 Basic Proof Tactics XII We introduce two more hypotheses HP and HQ. conj_ comm < intros HP HQ. P : Prop Q : Prop conj : P /\ Q HP : P HQ : Q Q /\ P Now we can use the hypotheses HP and HQ. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

18 Basic Proof Tactics XIII The tactic split splits a conjunction into two. conj_ comm < split. 2 subgoals P : Prop Q : Prop conj : P /\ Q HP : P HQ : Q Q subgoal 2 is: P How does split compare to i? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

19 Basic Proof Tactics XIV We use hypotheses to prove the lemma. conj_ comm < exact HQ. P : Prop Q : Prop conj : P /\ Q HP : P HQ : Q P conj_ comm < exact HP. Proof completed. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

20 Basic Proof Tactics XV Let us finish up the lemma and see its proof term. conj_ comm < Qed. intros conj. elim conj. intros HP HQ. split. exact HQ. exact HP. conj_ comm is defined Coq < Print conj_ comm. conj_ comm = fun conj0 : P /\ Q => and_ind ( fun (HP : P) (HQ : Q) => conj HQ HP) conj0 : P /\ Q -> Q /\ P Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

21 Basic Proof Tactics XVI Let us try to prove P Q Q P. Coq < Lemma disj_ comm : P \/ Q -> Q \/ P. P : Prop Q : Prop P \/ Q -> Q \/ P disj_ comm < intros disj. P : Prop Q : Prop disj : P \/ Q Q \/ P Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

22 Basic Proof Tactics XVII We eliminate the hypothesis disj. disj_ comm < elim disj. 2 subgoals P : Prop Q : Prop disj : P \/ Q P -> Q \/ P subgoal 2 is: Q -> Q \/ P How does elim compare to e? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

23 Basic Proof Tactics XVIII We next introduce a new hypothesis P. disj_ comm < intros HP. 2 subgoals P : Prop Q : Prop disj : P \/ Q HP : P Q \/ P subgoal 2 is: Q -> Q \/ P Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

24 Basic Proof Tactics XIX The tactic right selects the left operand in a disjunction. disj_ comm < right. 2 subgoals P : Prop Q : Prop disj : P \/ Q HP : P P subgoal 2 is: Q -> Q \/ P How does right compare to i 2? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

25 Basic Proof Tactics XX The tactic assumption searches an exact hypothesis for the conclusion. disj_ comm < assumption. P : Prop Q : Prop disj : P \/ Q Q -> Q \/ P We can combine a sequence of tactics by semicolon (;). disj_ comm < intros HQ; left ; assumption. Proof completed. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

26 Basic Proof Tactics XXI We finish up the lemma and print our proof. disj_ comm < Qed. intros disj. elim disj. intros HP. right. assumption. intros HQ; left ; assumption. disj_ comm is defined Coq < Print disj_ comm. disj_ comm = fun disj : P \/ Q => or_ind ( fun HP : P => or_ intror Q HP) ( fun HQ : Q => or_ introl P HQ) disj : P \/ Q -> Q \/ P Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

27 Basic Proof Tactics XXII Let us prove a lemma about double negation: P P. Coq < Lemma PNNP : P -> ~~ P. P : Prop Q : Prop P -> ~ ~ P PNNP < intros HP. P : Prop Q : Prop HP : P ~ ~ P Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

28 Basic Proof Tactics XXIII In Coq, P is a shorthand for P. We use red to expand a toplevel shorthand. PNNP < red. P : Prop Q : Prop HP : P ~ P -> False Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

29 Basic Proof Tactics XXIV We introduce another hypothesis P. PNNP < intros HNP. P : Prop Q : Prop HP : P HNP : ~ P False How does this intros compare to i? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

30 Basic Proof Tactics XXV We have P and P. The tactic absurd P exploits the contraction. PNNP < absurd P. 2 subgoals P : Prop Q : Prop HP : P HNP : ~ P ~ P subgoal 2 is: P How does absurd compare to e? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

31 Basic Proof Tactics XXVI The tactic trivial performs a simple proof search. PNNP < trivial. P : Prop Q : Prop HP : P HNP : ~ P P PNNP < trivial. Proof completed. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

32 Basic Proof Tactics XXVII Let us finish up the lemma, conclude the section, and check it. PNNP < Qed. intros HP. red. intros HNP. absurd P. trivial. trivial. PNNP is defined Coq < End Simple. Coq < Check PNNP. PNNP : forall P : Prop, P -> ~ ~ P Note the hypothesis P is generalized after closing the section. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

33 Basic Proof Tactics XXVIII Coq actually provides a complete tactic tauto. Coq < Hypotheses P Q R S : Prop. P is assumed Q is assumed R is assumed S is assumed Coq < Hypothesis H0 : (P /\ Q) -> R. H0 is assumed Coq < Hypothesis H1 : R -> S. H1 is assumed Coq < Hypothesis H2 : Q /\ ~S. H2 is assumed Coq < Lemma homework : ~P. P : Prop Q : Prop R : Prop S : Prop H0 : P /\ Q -> R H1 : R -> S H2 : Q /\ ~ S ~ P homework < tauto. Proof completed. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

34 Basic Proof Tactics XXIX Coq in fact uses intuitionistic logic. Coq < Goal forall P : Prop, P \/ ~P. forall P : Prop, P \/ ~ P Unnamed_thm < tauto. Toplevel input, characters 0-5: > tauto. > ^^^^^ Error : tauto failed. Goal declares an unnamed lemma. To do classical logic, add Coq < Require Import Classical. Coq < Check classic. classic : forall P : Prop, P \/ ~ P Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

35 More Proof Tactics I Let us set up a section for predicate logic. Coq < Section Easy. Coq < Hypothesis D : Set. D is assumed Coq < Hypothesis R : D -> D -> Prop. R is assumed In a new section, we declare a set D and a binary predicate symbol R. Let us set up a subsection where R is symmetric and transitive. Coq < Section R_sym_trans. Coq < Hypothesis R_symmetric : forall x y : D, R x y -> R y x. R_symmetric is assumed Coq < Hypothesis R_transitive : forall x y z : D, R x y -> R y z -> R x z. R_transitive is assumed Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

36 More Proof Tactics II Let us prove x D( y D, (Rxy) Rxx). Coq < Lemma refl_if : forall x : D, ( exists y, R x y) -> R x x. D : Set R : D -> D -> Prop R_symmetric : forall x y : D, R x y -> R y x R_transitive : forall x y z : D, R x y -> R y z -> R x z forall x : D, ( exists y : D, R x y) -> R x x Our predicate logic formula is written as forall x : D, (exists y, R x y) -> R x x. Observe that we did not specify y D but Coq infers it anyway. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

37 More Proof Tactics III The tactic intros again introduces a new hypothesis. refl_if < intros x. D : Set R : D -> D -> Prop R_symmetric : forall x y : D, R x y -> R y x R_transitive : forall x y z : D, R x y -> R y z -> R x z x : D ( exists y : D, R x y) -> R x x How does it compare to i? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

38 More Proof Tactics IV We introduce another hypothesis y D(Rxy). refl_if < intros Ey. D : Set R : D -> D -> Prop R_symmetric : forall x y : D, R x y -> R y x R_transitive : forall x y z : D, R x y -> R y z -> R x z x : D Ey : exists y : D, R x y R x x This is simply i. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

39 More Proof Tactics V Let us eliminate y D(Rxy). refl_if < elim Ey. D : Set R : D -> D -> Prop R_symmetric : forall x y : D, R x y -> R y x R_transitive : forall x y z : D, R x y -> R y z -> R x z x : D Ey : exists y : D, R x y forall x0 : D, R x x0 -> R x x How does elim compare to e? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

40 More Proof Tactics VI We get the instance of y D(Rxy) by intros. refl_if < intros y Rxy. D : Set R : D -> D -> Prop R_symmetric : forall x y : D, R x y -> R y x R_transitive : forall x y z : D, R x y -> R y z -> R x z x : D Ey : exists y : D, R x y y : D Rxy : R x y R x x Now elim and intros look really like e. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

41 More Proof Tactics VII We apply the hypothesis R transitive. refl_if < apply R_transitive with y. 2 subgoals D : Set R : D -> D -> Prop R_symmetric : forall x y : D, R x y -> R y x R_transitive : forall x y z : D, R x y -> R y z -> R x z x : D Ey : exists y : D, R x y y : D Rxy : R x y R x y subgoal 2 is: R y x Note that we need to give the hint y. How does apply compare to e? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

42 More Proof Tactics VIII The first subgoal is trivial. refl_if < trivial. D : Set R : D -> D -> Prop R_symmetric : forall x y : D, R x y -> R y x R_transitive : forall x y z : D, R x y -> R y z -> R x z x : D Ey : exists y : D, R x y y : D Rxy : R x y R y x Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

43 More Proof Tactics IX For the other subgoal, we apply xy D(Rxy Ryx). refl_if < apply R_symmetric. D : Set R : D -> D -> Prop R_symmetric : forall x y : D, R x y -> R y x R_transitive : forall x y z : D, R x y -> R y z -> R x z x : D Ey : exists y : D, R x y y : D Rxy : R x y R x y Now the goal is trivial. refl_if < trivial. Proof completed. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

44 More Proof Tactics X Let us finish up the lemma and see the proof term. refl_if < Qed. intros x. intros Ey. elim Ey. intros y Rxy. apply R_transitive with y. trivial. apply R_symmetric. trivial. refl_if is defined Coq < Print refl_if. refl_if = fun ( x : D) ( Ey : exists y : D, R x y) => ex_ind ( fun (y : D) ( Rxy : R x y) => R_transitive x y x Rxy ( R_symmetric x y Rxy )) Ey : forall x : D, ( exists y : D, R x y) -> R x x Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

45 Smullyan s Drinkers Paradox I We will prove Smullyan s drinkers paradox: in any non-empty bar, there is a person such that she drinks then everyone drinks. Let us set up the context. Coq < Section DrinkersParadox. Coq < Require Import Classical. Coq < Hypothesis bar : Set. bar is assumed Coq < Hypothesis Joe : bar. Joe is assumed Coq < Hypothesis drinks : bar -> Prop. drinks is assumed Note that Joe is in the bar. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

46 Smullyan s Drinkers Paradox II Here is what we want to prove. Coq < Lemma drinker : exists x : bar, drinks x -> forall y : bar, drinks y. bar : Set Joe : bar drinks : bar -> Prop exists x : bar, drinks x -> forall y : bar, drinks y Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

47 Smullyan s Drinkers Paradox III By LEM, we have ( x bar( drinks x)) ( x bar( drinks x)). We consider the two cases. drinker < Check ( classic ( exists x : bar, ~ drinks x)). classic ( exists x : bar, ~ drinks x) : ( exists x : bar, ~ drinks x) \/ ~ ( exists x : bar, ~ drinks x) drinker < elim ( classic ( exists x : bar, ~ drinks x)). 2 subgoals bar : Set Joe : bar drinks : bar -> Prop ( exists x : bar, ~ drinks x) -> exists x : bar, drinks x -> forall y : bar, drinks y subgoal 2 is: ~ ( exists x : bar, ~ drinks x) -> exists x : bar, drinks x -> forall y : bar, drinks y Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

48 Smullyan s Drinkers Paradox IV We introduce the hypothesis non drinker. drinker < intros non_drinker. 2 subgoals bar : Set Joe : bar drinks : bar -> Prop non_drinker : exists x : bar, ~ drinks x exists x : bar, drinks x -> forall y : bar, drinks y subgoal 2 is: ~ ( exists x : bar, ~ drinks x) -> exists x : bar, drinks x -> forall y : bar, drinks y Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

49 Smullyan s Drinkers Paradox V We eliminate non drinker and obtain an instance. drinker < elim non_drinker ; intros Jane Jane_non_drinker. 2 subgoals bar : Set Joe : bar drinks : bar -> Prop non_drinker : exists x : bar, ~ drinks x Jane : bar Jane_non_drinker : ~ drinks Jane exists x : bar, drinks x -> forall y : bar, drinks y subgoal 2 is: ~ ( exists x : bar, ~ drinks x) -> exists x : bar, drinks x -> forall y : bar, drinks y Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

50 Smullyan s Drinkers Paradox VI The tactic exists uses a term as a witness to an existential formula. drinker < exists Jane. 2 subgoals bar : Set Joe : bar drinks : bar -> Prop non_drinker : exists x : bar, ~ drinks x Jane : bar Jane_non_drinker : ~ drinks Jane drinks Jane -> forall y : bar, drinks y subgoal 2 is: ~ ( exists x : bar, ~ drinks x) -> exists x : bar, drinks x -> forall y : bar, drinks y How does exists compare to i? Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

51 Smullyan s Drinkers Paradox VII Observe that we have a contradiction. The tactic tauto will do. drinker < tauto. bar : Set Joe : bar drinks : bar -> Prop ~ ( exists x : bar, ~ drinks x) -> exists x : bar, drinks x -> forall y : bar, drinks y Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

52 Smullyan s Drinkers Paradox VIII We introduce a hypothesis for the other subgoal. drinker < intros no_non_drinker. bar : Set Joe : bar drinks : bar -> Prop no_non_drinker : ~ ( exists x : bar, ~ drinks x) exists x : bar, drinks x -> forall y : bar, drinks y Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

53 Smullyan s Drinkers Paradox IX Joe is our witness. drinker < exists Joe. bar : Set Joe : bar drinks : bar -> Prop no_non_drinker : ~ ( exists x : bar, ~ drinks x) drinks Joe -> forall y : bar, drinks y We introduce more hypotheses. drinker < intros Joe_drinker y. bar : Set Joe : bar drinks : bar -> Prop no_non_drinker : ~ ( exists x : bar, ~ drinks x) Joe_drinker : drinks Joe y: bar drinks y Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

54 Smullyan s Drinkers Paradox X For y bar, we have drinks y drinks y by LEM. drinker < elim ( classic ( drinks y)). 2 subgoals bar : Set Joe : bar drinks : bar -> Prop no_non_drinker : ~ ( exists x : bar, ~ drinks x) Joe_drinker : drinks Joe y : bar drinks y -> drinks y subgoal 2 is: ~ drinks y -> drinks y Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

55 Smullyan s Drinkers Paradox XI The first subgoal is easy. drinker < tauto. bar : Set Joe : bar drinks : bar -> Prop no_non_drinker : ~ ( exists x : bar, ~ drinks x) Joe_drinker : drinks Joe y : bar ~ drinks y -> drinks y Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

56 Smullyan s Drinkers Paradox XII We introduce a hypothesis that y does not drink. drinker < intros y_non_drinker. bar : Set Joe : bar drinks : bar -> Prop no_non_drinker : ~ ( exists x : bar, ~ drinks x) Joe_drinker : drinks Joe y : bar y_non_drinker : ~ drinks y drinks y Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

57 Smullyan s Drinkers Paradox XIII This is contradictory to no non drinker. drinker < absurd ( exists x, ~ drinks x). 2 subgoals bar : Set Joe : bar drinks : bar -> Prop no_non_drinker : ~ ( exists x : bar, ~ drinks x) Joe_drinker : drinks Joe y : bar y_non_drinker : ~ drinks y ~ ( exists x : bar, ~ drinks x) subgoal 2 is: exists x : bar, ~ drinks x Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

58 Smullyan s Drinkers Paradox XIV Again, the first subgoal is trivial. The second subgoal has a witness y. drinker < trivial. bar : Set Joe : bar drinks : bar -> Prop no_non_drinker : ~ ( exists x : bar, ~ drinks x) Joe_drinker : drinks Joe y : bar y_non_drinker : ~ drinks y exists x : bar, ~ drinks x drinker < exists y; trivial. Proof completed. Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

59 Smullyan s Drinkers Paradox XV Let us finish up the lemma and see its proof term. drinker < Qed. (* proof script skipped *) Coq < Print drinker. drinker = or_ind ( fun non_drinker : exists x : bar, ~ drinks x => ex_ind (fun (Jane : bar ) ( Jane_non_drinker : ~ drinks Jane ) => ex_intro ( fun x : bar => drinks x -> forall y : bar, drinks y) Jane ( fun H : drinks Jane => let H0 := Jane_non_drinker H in False_ind ( forall y : bar, drinks y) H0 )) non_drinker ) (fun no_non_drinker : ~ ( exists x : bar, ~ drinks x) => ex_intro ( fun x : bar => drinks x -> forall y : bar, drinks y) Joe ( fun (_ : drinks Joe ) (y : bar ) => or_ind ( fun H : drinks y => H) ( fun y_non_drinker : ~ drinks y => False_ind ( drinks y) ( let H := ex_intro ( fun x : bar => ~ drinks x) y y_non_drinker in ( let H0 := no_non_drinker in fun H1 : exists x : bar, ~ drinks x => H0 H1) H)) ( classic ( drinks y )))) ( classic ( exists x : bar, ~ drinks x)) : exists x : bar, drinks x -> forall y : bar, drinks y Bow-Yaw Wang (Academia Sinica) The Coq Proof Assistant October 15, / 59

Predicate Logic. Bow-Yaw Wang. Institute of Information Science Academia Sinica, Taiwan. November 22, 2017

Predicate Logic. Bow-Yaw Wang. Institute of Information Science Academia Sinica, Taiwan. November 22, 2017 Predicate Logic Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan November 22, 2017 Bow-Yaw Wang (Academia Sinica) Predicate Logic November 22, 2017 1 / 157 8 The Coq Proof Assistant

More information

Summer Review Packet AP Calculus

Summer Review Packet AP Calculus Summer Review Packet AP Calculus ************************************************************************ Directions for this packet: On a separate sheet of paper, show your work for each problem in this

More information

Natural Deduction for Propositional Logic

Natural Deduction for Propositional Logic Natural Deduction for Propositional Logic Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan September 10, 2018 Bow-Yaw Wang (Academia Sinica) Natural Deduction for Propositional Logic

More information

Introduction to Z3. Bow-Yaw Wang. December 19, Institute of Information Science Academia Sinica, Taiwan

Introduction to Z3. Bow-Yaw Wang. December 19, Institute of Information Science Academia Sinica, Taiwan Introduction to Z3 Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan December 19, 2017 Bow-Yaw Wang (Academia Sinica) Introduction to Z3 December 19, 2017 1 / 26 Outline 1 Introduction

More information

Propositions and Proofs

Propositions and Proofs Propositions and Proofs Gert Smolka, Saarland University April 25, 2018 Proposition are logical statements whose truth or falsity can be established with proofs. Coq s type theory provides us with a language

More information

Manual of Logical Style

Manual of Logical Style Manual of Logical Style Dr. Holmes January 9, 2015 Contents 1 Introduction 2 2 Conjunction 3 2.1 Proving a conjunction...................... 3 2.2 Using a conjunction........................ 3 3 Implication

More information

Normal Forms of Propositional Logic

Normal Forms of Propositional Logic Normal Forms of Propositional Logic Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan September 12, 2017 Bow-Yaw Wang (Academia Sinica) Normal Forms of Propositional Logic September

More information

Negation introduction

Negation introduction Negation introduction How do we prove a negation? P = P F -introduction {Assume} P (l-1) F { -intro on and (l-1)} (l) P -intro Negation elimination -elimination How do we use a negation in a proof? P (l)

More information

Iv roman numerals. Cari untuk: Cari Cari

Iv roman numerals. Cari untuk: Cari Cari Cari untuk: Cari Cari Iv roman numerals 29-4-2010 Readers Georgia and Gecko are both curious about clocks. Georgia wrote in to ask, "Why is it that some analog clocks with Roman numerals have '4' as '

More information

1. 4 2y 1 2 = x = x 1 2 x + 1 = x x + 1 = x = 6. w = 2. 5 x

1. 4 2y 1 2 = x = x 1 2 x + 1 = x x + 1 = x = 6. w = 2. 5 x .... VII x + x + = x x x 8 x x = x + a = a + x x = x + x x Solve the absolute value equations.. z = 8. x + 7 =. x =. x =. y = 7 + y VIII Solve the exponential equations.. 0 x = 000. 0 x+ = 00. x+ = 8.

More information

Discrete Structures. Lecture Notes for CSE 191. Matthew G. Knepley

Discrete Structures. Lecture Notes for CSE 191. Matthew G. Knepley Discrete Structures Lecture Notes for CSE 191 Matthew G. Knepley Department of Computer Science and Engineering University At Buffalo April 26, 2018 I dedicate these notes to my wonderful wife Margarete,

More information

5 Years (10 Semester) Integrated UG/PG Program in Physics & Electronics

5 Years (10 Semester) Integrated UG/PG Program in Physics & Electronics Courses Offered: 5 Years (10 ) Integrated UG/PG Program in Physics & Electronics 2 Years (4 ) Course M. Sc. Physics (Specialization in Material Science) In addition to the presently offered specialization,

More information

Deductive Systems. Lecture - 3

Deductive Systems. Lecture - 3 Deductive Systems Lecture - 3 Axiomatic System Axiomatic System (AS) for PL AS is based on the set of only three axioms and one rule of deduction. It is minimal in structure but as powerful as the truth

More information

Methods for Marsh Futures Area of Interest (AOI) Elevation Zone Delineation

Methods for Marsh Futures Area of Interest (AOI) Elevation Zone Delineation PARTNERSHIP FOR THE DELAWARE ESTUARY Science Group Methods for Marsh Futures Area of Interest (AOI) Elevation Zone Delineation Date Prepared: 07/30/2015 Prepared By: Joshua Moody Suggested Citation: Moody,

More information

Beyond First-Order Logic

Beyond First-Order Logic Beyond First-Order Logic Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) Beyond First-Order Logic MFES 2008/09 1 / 37 FOL

More information

Preface to the First Edition. xxvii 0.1 Set-theoretic Notation xxvii 0.2 Proof by Induction xxix 0.3 Equivalence Relations and Equivalence Classes xxx

Preface to the First Edition. xxvii 0.1 Set-theoretic Notation xxvii 0.2 Proof by Induction xxix 0.3 Equivalence Relations and Equivalence Classes xxx Table of Preface to the First Edition Preface to the Second Edition page xvii xxi Mathematical Prolegomenon xxvii 0.1 Set-theoretic Notation xxvii 0.2 Proof by Induction xxix 0.3 Equivalence Relations

More information

Automating Interactive Theorem Proving with Coq and Ltac. by Oron Propp and Alex Sekula Mentored by Drew Haven PRIMES

Automating Interactive Theorem Proving with Coq and Ltac. by Oron Propp and Alex Sekula Mentored by Drew Haven PRIMES Automating Interactive Theorem Proving with Coq and Ltac by Oron Propp and Alex Sekula Mentored by Drew Haven PRIMES Motivation Math is usually written by hand, checked by other mathematicians Verifying

More information

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson Natural Deduction Formal Methods in Verification of Computer Systems Jeremy Johnson Outline 1. An example 1. Validity by truth table 2. Validity by proof 2. What s a proof 1. Proof checker 3. Rules of

More information

A Revised Denotational Semantics for the Dataflow Algebra. A. J. Cowling

A Revised Denotational Semantics for the Dataflow Algebra. A. J. Cowling Verification and Testing Research Group, Department of Computer Science, University of Sheffield, Regent Court, 211, Portobello Street, Sheffield, S1 4DP, United Kingdom Email: A.Cowling @ dcs.shef.ac.uk

More information

Analyse et Conception Formelle. Lesson 4. Proofs with a proof assistant

Analyse et Conception Formelle. Lesson 4. Proofs with a proof assistant Analyse et Conception Formelle Lesson 4 Proofs with a proof assistant T. Genet (ISTIC/IRISA) ACF-4 1 / 26 Prove logic formulas... to prove programs fun nth:: "nat => a list => a" where "nth 0 (x#_)=x"

More information

Propositional Logic. CS 3234: Logic and Formal Systems. Martin Henz and Aquinas Hobor. August 26, Generated on Tuesday 31 August, 2010, 16:54

Propositional Logic. CS 3234: Logic and Formal Systems. Martin Henz and Aquinas Hobor. August 26, Generated on Tuesday 31 August, 2010, 16:54 Propositional Logic CS 3234: Logic and Formal Systems Martin Henz and Aquinas Hobor August 26, 2010 Generated on Tuesday 31 August, 2010, 16:54 1 Motivation In traditional logic, terms represent sets,

More information

Factorizations of b n ±1, Up to High Powers. Third Edition. John Brillhart, D. H. Lehmer J. L. Selfridge, Bryant Tuckerman, and S. S. Wagstaff, Jr.

Factorizations of b n ±1, Up to High Powers. Third Edition. John Brillhart, D. H. Lehmer J. L. Selfridge, Bryant Tuckerman, and S. S. Wagstaff, Jr. CONTEMPORARY MATHEMATICS 22 Factorizations of b n ±1, b = 2, 3, 5, 6, 7,10, 11, 12 Up to High Powers Third Edition John Brillhart, D. H. Lehmer J. L. Selfridge, Bryant Tuckerman, and S. S. Wagstaff, Jr.

More information

Logic for Computer Science - Week 4 Natural Deduction

Logic for Computer Science - Week 4 Natural Deduction Logic for Computer Science - Week 4 Natural Deduction 1 Introduction In the previous lecture we have discussed some important notions about the semantics of propositional logic. 1. the truth value of a

More information

15414/614 Optional Lecture 1: Propositional Logic

15414/614 Optional Lecture 1: Propositional Logic 15414/614 Optional Lecture 1: Propositional Logic Qinsi Wang Logic is the study of information encoded in the form of logical sentences. We use the language of Logic to state observations, to define concepts,

More information

Lecture Notes on Quantification

Lecture Notes on Quantification Lecture Notes on Quantification 15-317: Constructive Logic Frank Pfenning Lecture 5 September 8, 2009 1 Introduction In this lecture, we introduce universal and existential quantification As usual, we

More information

Handout: Proof of the completeness theorem

Handout: Proof of the completeness theorem MATH 457 Introduction to Mathematical Logic Spring 2016 Dr. Jason Rute Handout: Proof of the completeness theorem Gödel s Compactness Theorem 1930. For a set Γ of wffs and a wff ϕ, we have the following.

More information

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook) Lecture 2 Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits Reading (Epp s textbook) 2.1-2.4 1 Logic Logic is a system based on statements. A statement (or

More information

Introduction to Isabelle/HOL

Introduction to Isabelle/HOL Introduction to Isabelle/HOL 1 Notes on Isabelle/HOL Notation In Isabelle/HOL: [ A 1 ;A 2 ; ;A n ]G can be read as if A 1 and A 2 and and A n then G 3 Note: -Px (P x) stands for P (x) (P(x)) -P(x, y) can

More information

Interactive Theorem Provers

Interactive Theorem Provers Interactive Theorem Provers from the perspective of Isabelle/Isar Makarius Wenzel Univ. Paris-Sud, LRI July 2014 = Isabelle λ β Isar α 1 Introduction Notable ITP systems LISP based: ACL2 http://www.cs.utexas.edu/users/moore/acl2

More information

Shareholding as a % of total no. of shares (calculated as per SCRR, 1957) Number of Voting Rights held in each class of securities

Shareholding as a % of total no. of shares (calculated as per SCRR, 1957) Number of Voting Rights held in each class of securities Sr. No. Particulars 1. Name of Listed Entity : Symphony Limited 2. Scrip Code/Name of Scrip/Class of Security : SYMPHONY 3. Share Holding Pattern Filed under : 31 (1) 4. Share Holding Pattern as on : 30

More information

MAT063 and MAT065 FINAL EXAM REVIEW FORM 1R x

MAT063 and MAT065 FINAL EXAM REVIEW FORM 1R x Page NEW YORK CITY COLLEGE OF TECHNOLOGY of the City University of New York R DEPARTMENT OF MATHEMATICS Revised Spring 0 W. Colucci, D. DeSantis, and P. Deraney. Updated Fall 0 S. Singh MAT06 and MAT06

More information

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/33

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/33 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter 4.1-4.8 p. 1/33 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer

More information

CITS2211 Discrete Structures Proofs

CITS2211 Discrete Structures Proofs CITS2211 Discrete Structures Proofs Unit coordinator: Rachel Cardell-Oliver August 13, 2017 Highlights 1 Arguments vs Proofs. 2 Proof strategies 3 Famous proofs Reading Chapter 1: What is a proof? Mathematics

More information

EP elements in rings

EP elements in rings EP elements in rings Dijana Mosić, Dragan S. Djordjević, J. J. Koliha Abstract In this paper we present a number of new characterizations of EP elements in rings with involution in purely algebraic terms,

More information

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 13: Algorithmic Unsolvability The Halting Problem I In the last lecture we have shown

More information

Part Two: The Basic Components of the SOFL Specification Language

Part Two: The Basic Components of the SOFL Specification Language Part Two: The Basic Components of the SOFL Specification Language SOFL logic Module Condition Data Flow Diagrams Process specification Function definition and specification Process decomposition Other

More information

Recursion and Intro to Coq

Recursion and Intro to Coq L02-1 Recursion and Intro to Coq Armando Solar Lezama Computer Science and Artificial Intelligence Laboratory M.I.T. With content from Arvind and Adam Chlipala. Used with permission. September 21, 2015

More information

c 2011 JOSHUA DAVID JOHNSTON ALL RIGHTS RESERVED

c 2011 JOSHUA DAVID JOHNSTON ALL RIGHTS RESERVED c 211 JOSHUA DAVID JOHNSTON ALL RIGHTS RESERVED ANALYTICALLY AND NUMERICALLY MODELING RESERVOIR-EXTENDED POROUS SLIDER AND JOURNAL BEARINGS INCORPORATING CAVITATION EFFECTS A Dissertation Presented to

More information

Chromatically Unique Bipartite Graphs With Certain 3-independent Partition Numbers III ABSTRACT

Chromatically Unique Bipartite Graphs With Certain 3-independent Partition Numbers III ABSTRACT Malaysian Chromatically Journal of Mathematical Unique Biparte Sciences Graphs with 1(1: Certain 139-16 3-Independent (007 Partition Numbers III Chromatically Unique Bipartite Graphs With Certain 3-independent

More information

CIS 500: Software Foundations

CIS 500: Software Foundations CIS 500: Software Foundations Midterm I October 3, 2017 Directions: This exam booklet contains both the standard and advanced track questions. Questions with no annotation are for both tracks. Other questions

More information

15414/614 Optional Lecture 3: Predicate Logic

15414/614 Optional Lecture 3: Predicate Logic 15414/614 Optional Lecture 3: Predicate Logic Anvesh Komuravelli 1 Why Predicate Logic? Consider the following statements. 1. Every student is younger than some instructor. 2. Not all birds can fly. Propositional

More information

Acyclicity and Finite Linear Extendability: a Formal and Constructive Equivalence

Acyclicity and Finite Linear Extendability: a Formal and Constructive Equivalence Acyclicity and Finite Linear Extendability: a Formal and Constructive Equivalence LIP, Stéphane Le Roux École normale supérieure de Lyon, France stephane.le.roux@ens-lyon.fr Abstract. Linear extension

More information

KE/Tableaux. What is it for?

KE/Tableaux. What is it for? CS3UR: utomated Reasoning 2002 The term Tableaux refers to a family of deduction methods for different logics. We start by introducing one of them: non-free-variable KE for classical FOL What is it for?

More information

I) Simplifying fractions: x x. 1) 1 1 y x. 1 1 x 1. 4 x. 13x. x y xy. x 2. Factoring: 10) 13) 12) III) Solving: x 9 Prime (using only) 11)

I) Simplifying fractions: x x. 1) 1 1 y x. 1 1 x 1. 4 x. 13x. x y xy. x 2. Factoring: 10) 13) 12) III) Solving: x 9 Prime (using only) 11) AP Calculus Summer Packet Answer Key Reminders:. This is not an assignment.. This will not be collected.. You WILL be assessed on these skills at various times throughout the course.. You are epected to

More information

Proof Calculus for Partial Correctness

Proof Calculus for Partial Correctness Proof Calculus for Partial Correctness Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan September 7, 2016 Bow-Yaw Wang (Academia Sinica) Proof Calculus for Partial Correctness September

More information

Summer Review Packet. for students entering. IB Math SL

Summer Review Packet. for students entering. IB Math SL Summer Review Packet for students entering IB Math SL The problems in this packet are designed to help you review topics that are important to your success in IB Math SL. Please attempt the problems on

More information

Main Issues in Computer Mathematics. Henk Barendregt Brouwer Institute Radboud University Nijmegen, The Netherlands

Main Issues in Computer Mathematics. Henk Barendregt Brouwer Institute Radboud University Nijmegen, The Netherlands Main Issues in Computer Mathematics Henk Barendregt Brouwer Institute Radboud University Nijmegen, The Netherlands Overview 1. The nature of mathematics 2 2. Computer Mathematics 4 3. Foundations 5 4.

More information

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Packet #1: Logic & Proofs. Applied Discrete Mathematics Packet #1: Logic & Proofs Applied Discrete Mathematics Table of Contents Course Objectives Page 2 Propositional Calculus Information Pages 3-13 Course Objectives At the conclusion of this course, you should

More information

Applied Logic for Computer Scientists. Answers to Some Exercises

Applied Logic for Computer Scientists. Answers to Some Exercises Applied Logic for Computer Scientists Computational Deduction and Formal Proofs Springer, 2017 doi: http://link.springer.com/book/10.1007%2f978-3-319-51653-0 Answers to Some Exercises Mauricio Ayala-Rincón

More information

Real-Time Software Transactional Memory: Contention Managers, Time Bounds, and Implementations

Real-Time Software Transactional Memory: Contention Managers, Time Bounds, and Implementations Real-Time Software Transactional Memory: Contention Managers, Time Bounds, and Implementations Mohammed El-Shambakey Dissertation Submitted to the Faculty of the Virginia Polytechnic Institute and State

More information

Acyclicity and Finite Linear Extendability: a Formal and Constructive Equivalence

Acyclicity and Finite Linear Extendability: a Formal and Constructive Equivalence Laboratoire de l Informatique du Parallélisme École Normale Supérieure de Lyon Unité Mixte de Recherche CNRS-INRIA-ENS LYON-UCBL n o 5668 Acyclicity and Finite Linear Extendability: a Formal and Constructive

More information

Analytical formulas for calculating the extremal ranks and inertias of A + BXB when X is a fixed-rank Hermitian matrix

Analytical formulas for calculating the extremal ranks and inertias of A + BXB when X is a fixed-rank Hermitian matrix Analytical formulas for calculating the extremal ranks and inertias of A + BXB when X is a fixed-rank Hermitian matrix Yongge Tian CEMA, Central University of Finance and Economics, Beijing 100081, China

More information

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications NICTA Advanced Course Theorem Proving Principles, Techniques, Applications λ 1 CONTENT Intro & motivation, getting started with Isabelle Foundations & Principles Lambda Calculus Higher Order Logic, natural

More information

Logic Overview, I. and T T T T F F F T F F F F

Logic Overview, I. and T T T T F F F T F F F F Logic Overview, I DEFINITIONS A statement (proposition) is a declarative sentence that can be assigned a truth value T or F, but not both. Statements are denoted by letters p, q, r, s,... The 5 basic logical

More information

The Curry-Howard Isomorphism

The Curry-Howard Isomorphism The Curry-Howard Isomorphism Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) The Curry-Howard Isomorphism MFES 2008/09

More information

BIOLOGY YEAR AT A GLANCE RESOURCE ( )

BIOLOGY YEAR AT A GLANCE RESOURCE ( ) BIOLOGY YEAR AT A GLANCE RESOURCE (2016-17) DATES TOPIC/BENCHMARKS QUARTER 1 LAB/ACTIVITIES 8/22 8/25/16 I. Introduction to Biology Lab 1: Seed Germination A. What is Biology B. Science in the real world

More information

BIOLOGY YEAR AT A GLANCE RESOURCE ( ) REVISED FOR HURRICANE DAYS

BIOLOGY YEAR AT A GLANCE RESOURCE ( ) REVISED FOR HURRICANE DAYS BIOLOGY YEAR AT A GLANCE RESOURCE (2017-18) REVISED FOR HURRICANE DAYS DATES TOPIC/BENCHMARKS QUARTER 1 LAB/ACTIVITIES 8/21 8/24/17 I. Introduction to Biology A. What is Biology B. Science in the real

More information

CS5371 Theory of Computation. Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)

CS5371 Theory of Computation. Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression) CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression) Objectives Prove the Pumping Lemma, and use it to show that there are non-regular languages

More information

Warm-Up Problem. Is the following true or false? 1/35

Warm-Up Problem. Is the following true or false? 1/35 Warm-Up Problem Is the following true or false? 1/35 Propositional Logic: Resolution Carmen Bruni Lecture 6 Based on work by J Buss, A Gao, L Kari, A Lubiw, B Bonakdarpour, D Maftuleac, C Roberts, R Trefler,

More information

Using the Prover I: Lee Pike. June 3, NASA Langley Formal Methods Group Using the Prover I:

Using the Prover I: Lee Pike. June 3, NASA Langley Formal Methods Group Using the Prover I: Basic Basic NASA Langley Formal Methods Group lee.s.pike@nasa.gov June 3, 2005 Basic Sequents Basic Sequent semantics: The conjunction of the antecedents above the turnstile implies the disjunction of

More information

logical verification lecture program extraction and prop2

logical verification lecture program extraction and prop2 logical verification lecture 7 2017-05-04 program extraction and prop2 overview program extraction program extraction: examples verified programs: alternative approach formulas of prop2 terminology proofs

More information

Type Systems as a Foundation for Reliable Computing

Type Systems as a Foundation for Reliable Computing Type Systems as a Foundation for Reliable Computing Robert Harper Carnegie Mellon University Summer School on Reliable Computing University of Oregon July, 2005 References These lectures are based on the

More information

Proof. Theorems. Theorems. Example. Example. Example. Part 4. The Big Bang Theory

Proof. Theorems. Theorems. Example. Example. Example. Part 4. The Big Bang Theory Proof Theorems Part 4 The Big Bang Theory Theorems A theorem is a statement we intend to prove using existing known facts (called axioms or lemmas) Used extensively in all mathematical proofs which should

More information

Logic and Proofs. (A brief summary)

Logic and Proofs. (A brief summary) Logic and Proofs (A brief summary) Why Study Logic: To learn to prove claims/statements rigorously To be able to judge better the soundness and consistency of (others ) arguments To gain the foundations

More information

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Final examination Logic & Set Theory (2IT61/2IT07/2IHT10) (correction model)

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Final examination Logic & Set Theory (2IT61/2IT07/2IHT10) (correction model) TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica Final examination Logic & Set Theory (2IT61/2IT07/2IHT10) (correction model) Thursday October 29, 2015, 9:00 12:00 hrs. (2) 1. Determine

More information

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter 5 p. 1/60

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter 5 p. 1/60 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter 5 p. 1/60 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science

More information

Program-ing in Coq. Matthieu Sozeau under the direction of Christine Paulin-Mohring

Program-ing in Coq. Matthieu Sozeau under the direction of Christine Paulin-Mohring Program-ing in Coq Matthieu Sozeau under the direction of Christine Paulin-Mohring LRI, Univ. Paris-Sud - Démons Team & INRIA Saclay - ProVal Project Foundations of Programming seminar February 15th 2008

More information

Interpolation and Polynomial Approximation I

Interpolation and Polynomial Approximation I Interpolation and Polynomial Approximation I If f (n) (x), n are available, Taylor polynomial is an approximation: f (x) = f (x 0 )+f (x 0 )(x x 0 )+ 1 2! f (x 0 )(x x 0 ) 2 + Example: e x = 1 + x 1! +

More information

Propositions and Proofs

Propositions and Proofs Chapter 2 Propositions and Proofs The goal of this chapter is to develop the two principal notions of logic, namely propositions and proofs There is no universal agreement about the proper foundations

More information

PHIL12A Section answers, 28 Feb 2011

PHIL12A Section answers, 28 Feb 2011 PHIL12A Section answers, 28 Feb 2011 Julian Jonker 1 How much do you know? Give formal proofs for the following arguments. 1. (Ex 6.18) 1 A B 2 A B 1 A B 2 A 3 A B Elim: 2 4 B 5 B 6 Intro: 4,5 7 B Intro:

More information

The Natural Deduction Pack

The Natural Deduction Pack The Natural Deduction Pack Alastair Carr March 2018 Contents 1 Using this pack 2 2 Summary of rules 3 3 Worked examples 5 31 Implication 5 32 Universal quantifier 6 33 Existential quantifier 8 4 Practice

More information

Mathematical Reasoning. The Foundation of Algorithmics

Mathematical Reasoning. The Foundation of Algorithmics Mathematical Reasoning The Foundation of Algorithmics The Nature of Truth In mathematics, we deal with statements that are True or False This is known as The Law of the Excluded Middle Despite the fact

More information

INF3170 Logikk Spring Homework #8 For Friday, March 18

INF3170 Logikk Spring Homework #8 For Friday, March 18 INF3170 Logikk Spring 2011 Homework #8 For Friday, March 18 Problems 2 6 have to do with a more explicit proof of the restricted version of the completeness theorem: if = ϕ, then ϕ. Note that, other than

More information

Topic 2060 Gibbs Energies; Salt Solutions; Aqueous Mixtures The solubilities of chemical substance j in two liquids l

Topic 2060 Gibbs Energies; Salt Solutions; Aqueous Mixtures The solubilities of chemical substance j in two liquids l Topic 6 Gibbs Energies; Salt Solutions; Aqueous Mixtures The solubilities of chemical substance in two liquids l and l (at the same T and p) offers a method for comparing the reference chemical potentials,

More information

Marie Duží

Marie Duží Marie Duží marie.duzi@vsb.cz 1 Formal systems, Proof calculi A proof calculus (of a theory) is given by: 1. a language 2. a set of axioms 3. a set of deduction rules ad 1. The definition of a language

More information

CS Lecture 19: Logic To Truth through Proof. Prof. Clarkson Fall Today s music: Theme from Sherlock

CS Lecture 19: Logic To Truth through Proof. Prof. Clarkson Fall Today s music: Theme from Sherlock CS 3110 Lecture 19: Logic To Truth through Proof Prof. Clarkson Fall 2014 Today s music: Theme from Sherlock Review Current topic: How to reason about correctness of code Last week: informal arguments

More information

Inductive Predicates

Inductive Predicates Inductive Predicates Gert Smolka, Saarland University June 12, 2017 We introduce inductive predicates as they are accommodated in Coq s type theory. Our prime example is the ordering predicate for numbers,

More information

SKETCHY NOTES FOR WEEKS 7 AND 8

SKETCHY NOTES FOR WEEKS 7 AND 8 SKETCHY NOTES FOR WEEKS 7 AND 8 We are now ready to start work on the proof of the Completeness Theorem for first order logic. Before we start a couple of remarks are in order (1) When we studied propositional

More information

Example ( x.(p(x) Q(x))) ( x.p(x) x.q(x)) premise. 2. ( x.(p(x) Q(x))) -elim, 1 3. ( x.p(x) x.q(x)) -elim, x. P(x) x.

Example ( x.(p(x) Q(x))) ( x.p(x) x.q(x)) premise. 2. ( x.(p(x) Q(x))) -elim, 1 3. ( x.p(x) x.q(x)) -elim, x. P(x) x. Announcements CS311H: Discrete Mathematics More Logic Intro to Proof Techniques Homework due next lecture Instructor: Işıl Dillig Instructor: Işıl Dillig, CS311H: Discrete Mathematics More Logic Intro

More information

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes These notes form a brief summary of what has been covered during the lectures. All the definitions must be memorized and understood. Statements

More information

Chapter 4: Classical Propositional Semantics

Chapter 4: Classical Propositional Semantics Chapter 4: Classical Propositional Semantics Language : L {,,, }. Classical Semantics assumptions: TWO VALUES: there are only two logical values: truth (T) and false (F), and EXTENSIONALITY: the logical

More information

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University COMP 182 Algorithmic Thinking Proofs Luay Nakhleh Computer Science Rice University 1 Reading Material Chapter 1, Section 3, 6, 7, 8 Propositional Equivalences The compound propositions p and q are called

More information

Discrete Mathematics

Discrete Mathematics Discrete Mathematics Jeremy Siek Spring 2010 Jeremy Siek Discrete Mathematics 1 / 24 Outline of Lecture 3 1. Proofs and Isabelle 2. Proof Strategy, Forward and Backwards Reasoning 3. Making Mistakes Jeremy

More information

First order Logic ( Predicate Logic) and Methods of Proof

First order Logic ( Predicate Logic) and Methods of Proof First order Logic ( Predicate Logic) and Methods of Proof 1 Outline Introduction Terminology: Propositional functions; arguments; arity; universe of discourse Quantifiers Definition; using, mixing, negating

More information

SUMMER VACATION ASSIGNMENT (MAY- JUNE 2015) CLASS X

SUMMER VACATION ASSIGNMENT (MAY- JUNE 2015) CLASS X SUMMER VACATION ASSIGNMENT (MAY- JUNE 2015) CLASS X ENGLISH Introduction to Poets and Authors: Make a power point presentation of 10 slides about an author or poet of your choice. The power point presentation

More information

Logic of Information p.45

Logic of Information p.45 Logic of Information p.45 CHAPTER 8 ALETHICS 8.1. The formal treatment of alethics could proceed quite independently of any representation. Yet, since helps both the exposition and the understanding of

More information

Math 3336: Discrete Mathematics Practice Problems for Exam I

Math 3336: Discrete Mathematics Practice Problems for Exam I Math 3336: Discrete Mathematics Practice Problems for Exam I The upcoming exam on Tuesday, February 26, will cover the material in Chapter 1 and Chapter 2*. You will be provided with a sheet containing

More information

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference)

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference) Today s Lecture 2/25/10 Truth Tables Continued Introduction to Proofs (the implicational rules of inference) Announcements Homework: -- Ex 7.3 pg. 320 Part B (2-20 Even). --Read chapter 8.1 pgs. 345-361.

More information

An Introduction to Proof Assistants

An Introduction to Proof Assistants An Introduction to Proof Assistants Patrick Schnider Student Seminar in Combinatorics: Mathematical Software, ETH Zürich 1 Motivation The development of proof assistants was motivated by the use of computers

More information

Transient Analysis of Single Phase Transformer Using State Model

Transient Analysis of Single Phase Transformer Using State Model Transient Analysis of Single Phase Transformer Using State Model Rikta Majumder 1, Suman Ghosh 2, Rituparna Mukherjee 3 Assistant Professor, Department of Electrical Engineering, GNIT, Kolkata, West Bengal,

More information

Discrete Mathematics

Discrete Mathematics Discrete Mathematics Jeremy Siek Spring 2010 Jeremy Siek Discrete Mathematics 1 / 20 Outline of Lecture 4 1. Overview of First-Order Logic 2. Beyond Booleans: natural numbers, integers, etc. 3. Universal

More information

Model for Dredging a Horizontal Trapezoidal Open Channel with Hydraulic Jump

Model for Dredging a Horizontal Trapezoidal Open Channel with Hydraulic Jump Journal of Mathematics Research; Vol. 4, No. 3; 2012 ISSN 1916-9795 E-ISSN 1916-9809 Published by Canadian Center of Science and Education Model for Dredging a Horizontal Trapezoidal Open Channel with

More information

Adam Blank Spring 2017 CSE 311. Foundations of Computing I

Adam Blank Spring 2017 CSE 311. Foundations of Computing I Adam Blank Spring 2017 CSE 311 Foundations of Computing I Pre-Lecture Problem Suppose that p, and p (q r) are true. Is q true? Can you prove it with equivalences? CSE 311: Foundations of Computing Lecture

More information

NOVUM ORGANON RENOVATUM

NOVUM ORGANON RENOVATUM NOVUM ORGANON RENOVATUM THOEMMES PRESS PREFACE PADB v BOOK I. APHORISMS CONCERNING IDEAS. APHORISMS I. XVIII. Ideas in general.. 5 7 XIX. XLIV.. Ideas in the Pure Sciences 8 12 XLV. LV. Ideas in the Mechanical

More information

Modal Logic. UIT2206: The Importance of Being Formal. Martin Henz. March 19, 2014

Modal Logic. UIT2206: The Importance of Being Formal. Martin Henz. March 19, 2014 Modal Logic UIT2206: The Importance of Being Formal Martin Henz March 19, 2014 1 Motivation The source of meaning of formulas in the previous chapters were models. Once a particular model is chosen, say

More information

Vector and Matrix Norms I

Vector and Matrix Norms I Vector and Matrix Norms I Scalar, vector, matrix How to calculate errors? Scalar: absolute error: ˆα α relative error: Vectors: vector norm Norm is the distance!! ˆα α / α Chih-Jen Lin (National Taiwan

More information

Introduction to Metalogic

Introduction to Metalogic Philosophy 135 Spring 2008 Tony Martin Introduction to Metalogic 1 The semantics of sentential logic. The language L of sentential logic. Symbols of L: Remarks: (i) sentence letters p 0, p 1, p 2,... (ii)

More information

Fixed Term Employment Contracts. in an Equilibrium Search Model

Fixed Term Employment Contracts. in an Equilibrium Search Model Supplemental material for: Fixed Term Employment Contracts in an Equilibrium Search Model Fernando Alvarez University of Chicago and NBER Marcelo Veracierto Federal Reserve Bank of Chicago This document

More information

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another. Math 0413 Appendix A.0 Logic Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another. This type of logic is called propositional.

More information

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

2. The Logic of Compound Statements Summary. Aaron Tan August 2017 2. The Logic of Compound Statements Summary Aaron Tan 21 25 August 2017 1 2. The Logic of Compound Statements 2.1 Logical Form and Logical Equivalence Statements; Compound Statements; Statement Form (Propositional

More information